diff --git a/Examples/AccountAlias/main.swift b/Examples/AccountAlias/main.swift index 4929eb77..2fdc9392 100644 --- a/Examples/AccountAlias/main.swift +++ b/Examples/AccountAlias/main.swift @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -84,22 +84,3 @@ internal enum Program { print("Example complete!") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/AccountAllowance/main.swift b/Examples/AccountAllowance/main.swift index c82d5042..3304d818 100644 --- a/Examples/AccountAllowance/main.swift +++ b/Examples/AccountAllowance/main.swift @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities private struct Account { internal let key: PrivateKey @@ -183,7 +183,7 @@ private func cleanUp( @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -193,22 +193,3 @@ internal enum Program { try await cleanUp(client, env.operatorAccountId, accounts) } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/AddNftAllowance/main.swift b/Examples/AddNftAllowance/main.swift index e247bef9..ef472483 100644 --- a/Examples/AddNftAllowance/main.swift +++ b/Examples/AddNftAllowance/main.swift @@ -18,12 +18,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -123,8 +123,8 @@ internal enum Program { // Step 6: Transfer NFT using approved allowance let transferReceipt = try await TransferTransaction() .approvedNftTransfer(NftId(tokenId: nftTokenId, serial: 1), env.operatorAccountId, receiverAccountId) - .freezeWith(client) .transactionId(TransactionId.generateFrom(spenderAccountId)) + .freezeWith(client) .sign(spenderKey) .execute(client) .getReceipt(client) @@ -155,20 +155,3 @@ internal enum Program { // Implement cleanup steps... } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the Hiero network this example should run against. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ConsensusPubSub/main.swift b/Examples/ConsensusPubSub/main.swift index f9bfb9fa..94d44b37 100644 --- a/Examples/ConsensusPubSub/main.swift +++ b/Examples/ConsensusPubSub/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -55,22 +55,3 @@ internal enum Program { } } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ConsensusPubSubChunked/main.swift b/Examples/ConsensusPubSubChunked/main.swift index d69ca043..6ea63417 100644 --- a/Examples/ConsensusPubSubChunked/main.swift +++ b/Examples/ConsensusPubSubChunked/main.swift @@ -3,13 +3,11 @@ import Foundation import Hiero import HieroExampleUtilities -import SwiftDotenv @main internal enum Program { internal static func main() async throws { - - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -50,14 +48,16 @@ internal enum Program { // now pretend we sent those bytes across the network // parse them into a transaction so we can sign as the submit key - let deserializedTransaction = try Transaction.fromBytes(transactionBytes) as! TopicMessageSubmitTransaction - + let deserializedTransaction = try Transaction.fromBytes(transactionBytes) + guard let topicMessageSubmitTransaction = deserializedTransaction as? TopicMessageSubmitTransaction else { + fatalError("Expected TopicMessageSubmitTransaction") + } // sign with that submit key - deserializedTransaction.sign(submitKey) + topicMessageSubmitTransaction.sign(submitKey) // now actually submit the transaction // get the receipt to ensure there were no errors - _ = try await deserializedTransaction.execute(client).getReceipt(client) + _ = try await topicMessageSubmitTransaction.execute(client).getReceipt(client) print("Finished sending the message, press ctrl+c to exit once it's recieved") } @@ -74,22 +74,3 @@ internal enum Program { } } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ConsensusPubSubWithSubmitKey/main.swift b/Examples/ConsensusPubSubWithSubmitKey/main.swift index 0ecf8958..f376aa62 100644 --- a/Examples/ConsensusPubSubWithSubmitKey/main.swift +++ b/Examples/ConsensusPubSubWithSubmitKey/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -61,22 +61,3 @@ internal enum Program { } } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateAccount/main.swift b/Examples/CreateAccount/main.swift index 0c8c6a9b..1eca4297 100644 --- a/Examples/CreateAccount/main.swift +++ b/Examples/CreateAccount/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -27,22 +27,3 @@ internal enum Program { print("account address = \(newAccountId)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateAccountThresholdKey/main.swift b/Examples/CreateAccountThresholdKey/main.swift index 89ea8b34..0de19fe2 100644 --- a/Examples/CreateAccountThresholdKey/main.swift +++ b/Examples/CreateAccountThresholdKey/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -63,22 +63,3 @@ internal enum Program { print("account balance after transfer: \(balanceAfter)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateAccountWithAlias/main.swift b/Examples/CreateAccountWithAlias/main.swift index 169e8310..28ac908a 100644 --- a/Examples/CreateAccountWithAlias/main.swift +++ b/Examples/CreateAccountWithAlias/main.swift @@ -20,13 +20,13 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { print("Starting Example") - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -145,22 +145,3 @@ internal enum Program { return true } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateFile/main.swift b/Examples/CreateFile/main.swift index a9ad2584..accf614d 100644 --- a/Examples/CreateFile/main.swift +++ b/Examples/CreateFile/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -28,22 +28,3 @@ internal enum Program { print("file: \(String(describing: receipt.fileId))") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateSimpleContract/main.swift b/Examples/CreateSimpleContract/main.swift index bc744af0..ba522aad 100644 --- a/Examples/CreateSimpleContract/main.swift +++ b/Examples/CreateSimpleContract/main.swift @@ -2,12 +2,11 @@ import Hiero import HieroExampleUtilities -import SwiftDotenv @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -62,22 +61,3 @@ internal enum Program { print("Contract successfully deleted") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateStatefulContract/main.swift b/Examples/CreateStatefulContract/main.swift index 3ece03fe..7d6c4224 100644 --- a/Examples/CreateStatefulContract/main.swift +++ b/Examples/CreateStatefulContract/main.swift @@ -2,12 +2,11 @@ import Hiero import HieroExampleUtilities -import SwiftDotenv @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -79,22 +78,3 @@ internal enum Program { print("contract returned message: \(String(describing: message2))") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateTopic/main.swift b/Examples/CreateTopic/main.swift index 7871f91d..b8c39ec2 100644 --- a/Examples/CreateTopic/main.swift +++ b/Examples/CreateTopic/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -28,22 +28,3 @@ internal enum Program { print("sequence number = \(sendReceipt.topicSequenceNumber)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/CreateTopicWithRevenue/main.swift b/Examples/CreateTopicWithRevenue/main.swift index b9802e49..5d1c717a 100644 --- a/Examples/CreateTopicWithRevenue/main.swift +++ b/Examples/CreateTopicWithRevenue/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Set operator account @@ -176,22 +176,3 @@ internal enum Program { return balance } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/DeleteAccount/main.swift b/Examples/DeleteAccount/main.swift index 7b194d98..cd8cf805 100644 --- a/Examples/DeleteAccount/main.swift +++ b/Examples/DeleteAccount/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -19,22 +19,3 @@ internal enum Program { _ = try await response.getReceipt(client) } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/DeleteFile/main.swift b/Examples/DeleteFile/main.swift index 154d077c..7b29744f 100644 --- a/Examples/DeleteFile/main.swift +++ b/Examples/DeleteFile/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -32,22 +32,3 @@ internal enum Program { print("File deleted successfully") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/FileAppendChunked/main.swift b/Examples/FileAppendChunked/main.swift index 6f7d5828..396d8217 100644 --- a/Examples/FileAppendChunked/main.swift +++ b/Examples/FileAppendChunked/main.swift @@ -1,12 +1,11 @@ import Hiero import HieroExampleUtilities -import SwiftDotenv @main internal enum Program { internal static func main() async throws { async let bigContents = HieroExampleUtilities.Resources.bigContents - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -39,22 +38,3 @@ internal enum Program { print("File content size according to `FileInfoQuery`: `\(contents.contents.count)` bytes") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/GetAccountBalance/main.swift b/Examples/GetAccountBalance/main.swift index 9b723ebc..f712152a 100644 --- a/Examples/GetAccountBalance/main.swift +++ b/Examples/GetAccountBalance/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) print(try await AccountBalanceQuery().accountId(1001).getCost(client)) @@ -18,12 +18,3 @@ internal enum Program { print("balance = \(balance.hbars)") } } - -extension Environment { - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/GetAccountInfo/main.swift b/Examples/GetAccountInfo/main.swift index 0b950696..adf0ddc7 100644 --- a/Examples/GetAccountInfo/main.swift +++ b/Examples/GetAccountInfo/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -20,22 +20,3 @@ internal enum Program { print("balance = \(info.balance)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/GetAddressBook/main.swift b/Examples/GetAddressBook/main.swift index 0d4ffc72..ef1498dd 100644 --- a/Examples/GetAddressBook/main.swift +++ b/Examples/GetAddressBook/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) print("Getting address book for \(env.networkName)") @@ -19,12 +19,3 @@ internal enum Program { print(results) } } - -extension Environment { - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/GetExchangeRates/main.swift b/Examples/GetExchangeRates/main.swift index f75928a5..73859061 100644 --- a/Examples/GetExchangeRates/main.swift +++ b/Examples/GetExchangeRates/main.swift @@ -1,12 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() + let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -31,28 +32,28 @@ internal enum Program { } } -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } - - /// The file ID for the exchange rates file. - /// - /// By default this is `FileId.exchangeRates`. - public var exchangeRatesFile: FileId { - try! (self["HEDERA_EXCHANGE_RATES_FILE"]?.stringValue).map(FileId.fromString) ?? FileId.exchangeRates - } -} +// extension Environment { +// /// Account ID for the operator to use in this example. +// internal var operatorAccountId: AccountId { +// AccountId(self["OPERATOR_ID"]!.stringValue)! +// } + +// /// Private key for the operator to use in this example. +// internal var operatorKey: PrivateKey { +// PrivateKey(self["OPERATOR_KEY"]!.stringValue)! +// } + +// /// The name of the hedera network this example should be ran against. +// /// +// /// Testnet by default. +// internal var networkName: String { +// self["HEDERA_NETWORK"]?.stringValue ?? "testnet" +// } + +// /// The file ID for the exchange rates file. +// /// +// /// By default this is `FileId.exchangeRates`. +// public var exchangeRatesFile: FileId { +// try! (self["HEDERA_EXCHANGE_RATES_FILE"]?.stringValue).map(FileId.fromString) ?? FileId.exchangeRates +// } +// } diff --git a/Examples/GetFileContents/main.swift b/Examples/GetFileContents/main.swift index 4ee2b000..35607d11 100644 --- a/Examples/GetFileContents/main.swift +++ b/Examples/GetFileContents/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -20,22 +20,3 @@ internal enum Program { print("contents = \(text)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/InitializeClientWithMirrorNetwork/main.swift b/Examples/InitializeClientWithMirrorNetwork/main.swift index f1550469..2eedfd47 100644 --- a/Examples/InitializeClientWithMirrorNetwork/main.swift +++ b/Examples/InitializeClientWithMirrorNetwork/main.swift @@ -2,12 +2,11 @@ import Hiero import HieroExampleUtilities -import SwiftDotenv @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() /* * Step 0: Create and Configure the Client @@ -36,22 +35,3 @@ internal enum Program { print("Alice's account ID: \(aliceId)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/LongTermScheduledTransaction/main.swift b/Examples/LongTermScheduledTransaction/main.swift index f1fa1be7..b7baf7e1 100644 --- a/Examples/LongTermScheduledTransaction/main.swift +++ b/Examples/LongTermScheduledTransaction/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() print("Long Term Scheduled Transaction Example Start!") @@ -161,21 +161,3 @@ internal enum Program { print("Successfully executed scheduled transaction") } } -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ModifyTokenKeys/main.swift b/Examples/ModifyTokenKeys/main.swift index 70f4a3a4..254bb230 100644 --- a/Examples/ModifyTokenKeys/main.swift +++ b/Examples/ModifyTokenKeys/main.swift @@ -1,31 +1,13 @@ -/* - * ‌ - * Hedera Swift SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ +// SPDX-License-Identifier: Apache-2.0 import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -145,22 +127,3 @@ internal enum Program { print("Supply Key (after removal): \(String(describing: tokenInfoAfterSupplyKeyRemoval.supplyKey))") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/MultiAppTransfer/main.swift b/Examples/MultiAppTransfer/main.swift index f6512c1b..843143f7 100644 --- a/Examples/MultiAppTransfer/main.swift +++ b/Examples/MultiAppTransfer/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -57,16 +57,19 @@ internal enum Program { let signedTxnBytes = try exchangeSignsTransaction(exchangeKey, transferTxn.toBytes()) // parse the transaction bytes returned from the exchange - let signedTransferTxn = try Transaction.fromBytes(signedTxnBytes) as! TransferTransaction + let signedTransferTxn = try Transaction.fromBytes(signedTxnBytes) + guard let transferTransaction = signedTransferTxn as? TransferTransaction else { + fatalError("Expected TransferTransaction") + } // get the amount we are about to transfer // we built this with +2, -2 (which we might see in any order) - let transferAmount = signedTransferTxn.hbarTransfers.values.first.map { $0 < 0 ? -$0 : $0 } + let transferAmount = transferTransaction.hbarTransfers.values.first.map { $0 < 0 ? -$0 : $0 } print("about to transfer \(String(describing: transferAmount))...") // we now execute the signed transaction and wait for it to be accepted - let transactionResponse = try await signedTransferTxn.execute(client) + let transactionResponse = try await transferTransaction.execute(client) // (important!) wait for consensus by querying for the receipt _ = try await transactionResponse.getReceipt(client) @@ -94,22 +97,3 @@ internal enum Program { .toBytes() } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/MultiSigOffline/main.swift b/Examples/MultiSigOffline/main.swift index db5bae94..2bf0af28 100644 --- a/Examples/MultiSigOffline/main.swift +++ b/Examples/MultiSigOffline/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -58,22 +58,3 @@ internal enum Program { print("\(receipt.status)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/NftUpdateMetadata/main.swift b/Examples/NftUpdateMetadata/main.swift index 640b50c0..7a3af29c 100644 --- a/Examples/NftUpdateMetadata/main.swift +++ b/Examples/NftUpdateMetadata/main.swift @@ -20,7 +20,7 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { @@ -30,7 +30,7 @@ internal enum Program { private static let newMetadata: Data = Data([1, 2]) internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -171,22 +171,3 @@ func getMetadataList(_ client: Client, _ tokenId: TokenId, _ serials: [UInt64]) return metadataList } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/Prng/main.swift b/Examples/Prng/main.swift index 8a67b4d9..f333c5db 100644 --- a/Examples/Prng/main.swift +++ b/Examples/Prng/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -24,22 +24,3 @@ internal enum Program { } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/Schedule/main.swift b/Examples/Schedule/main.swift index 0322fe1e..4a58dfb5 100644 --- a/Examples/Schedule/main.swift +++ b/Examples/Schedule/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -81,22 +81,3 @@ internal enum Program { print("https://\(env.networkName).mirrornode.hedera.com/api/v1/transactions/\(transactionIdString)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ScheduleIdenticalTransaction/main.swift b/Examples/ScheduleIdenticalTransaction/main.swift index 7715052e..520add4d 100644 --- a/Examples/ScheduleIdenticalTransaction/main.swift +++ b/Examples/ScheduleIdenticalTransaction/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -158,22 +158,3 @@ internal enum Program { .getReceipt(client) } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ScheduleMultiSigTransaction/main.swift b/Examples/ScheduleMultiSigTransaction/main.swift index dbbdb1d0..26257e04 100644 --- a/Examples/ScheduleMultiSigTransaction/main.swift +++ b/Examples/ScheduleMultiSigTransaction/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -76,9 +76,12 @@ internal enum Program { print("Schedule Info = \(info)") - let scheduledTransfer = try info.scheduledTransaction as! TransferTransaction + let scheduledTransfer = try info.scheduledTransaction + guard let transferTransaction = scheduledTransfer as? TransferTransaction else { + fatalError("Expected TransferTransaction") + } - let transfers = scheduledTransfer.hbarTransfers + let transfers = transferTransaction.hbarTransfers // Make sure the transfer transaction is what we expect precondition(transfers.count == 2, "more transfers than expected") @@ -105,22 +108,3 @@ internal enum Program { .execute(client) } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ScheduledTransactionMultiSigThreshold/main.swift b/Examples/ScheduledTransactionMultiSigThreshold/main.swift index 6a940ff5..d255fd4d 100644 --- a/Examples/ScheduledTransactionMultiSigThreshold/main.swift +++ b/Examples/ScheduledTransactionMultiSigThreshold/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -100,22 +100,3 @@ internal enum Program { print(recordScheduledTx) } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/ScheduledTransfer/main.swift b/Examples/ScheduledTransfer/main.swift index 16226dfe..bcee7662 100644 --- a/Examples/ScheduledTransfer/main.swift +++ b/Examples/ScheduledTransfer/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -113,7 +113,10 @@ internal enum Program { let scheduledTransaction = try scheduledTransactionInfo.scheduledTransaction // We happen to know that this transaction is (or certainly ought to be) a TransferTransaction - let scheduledTransfer = scheduledTransaction as! TransferTransaction + let scheduledTransfer = scheduledTransaction + guard let transferTransaction = scheduledTransfer as? TransferTransaction else { + fatalError("Expected TransferTransaction") + } print("The scheduled transfer transaction from Bob's POV:") print(scheduledTransfer) @@ -150,21 +153,21 @@ internal enum Program { } } -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} +// extension Environment { +// /// Account ID for the operator to use in this example. +// internal var operatorAccountId: AccountId { +// AccountId(self["OPERATOR_ID"]!.stringValue)! +// } + +// /// Private key for the operator to use in this example. +// internal var operatorKey: PrivateKey { +// PrivateKey(self["OPERATOR_KEY"]!.stringValue)! +// } + +// /// The name of the hedera network this example should be ran against. +// /// +// /// Testnet by default. +// internal var networkName: String { +// self["HEDERA_NETWORK"]?.stringValue ?? "testnet" +// } +// } diff --git a/Examples/Staking/main.swift b/Examples/Staking/main.swift index 4783a14d..19b2f67c 100644 --- a/Examples/Staking/main.swift +++ b/Examples/Staking/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -51,22 +51,3 @@ internal enum Program { print("staking info: \(String(describing: info.staking))") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/StakingWithUpdate/main.swift b/Examples/StakingWithUpdate/main.swift index dbf8ddc4..b0346b17 100644 --- a/Examples/StakingWithUpdate/main.swift +++ b/Examples/StakingWithUpdate/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -70,21 +70,21 @@ internal enum Program { } } -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} +// extension Environment { +// /// Account ID for the operator to use in this example. +// internal var operatorAccountId: AccountId { +// AccountId(self["OPERATOR_ID"]!.stringValue)! +// } + +// /// Private key for the operator to use in this example. +// internal var operatorKey: PrivateKey { +// PrivateKey(self["OPERATOR_KEY"]!.stringValue)! +// } + +// /// The name of the hedera network this example should be ran against. +// /// +// /// Testnet by default. +// internal var networkName: String { +// self["HEDERA_NETWORK"]?.stringValue ?? "testnet" +// } +// } diff --git a/Examples/TokenAirdrop/main.swift b/Examples/TokenAirdrop/main.swift index 39124956..592044fb 100644 --- a/Examples/TokenAirdrop/main.swift +++ b/Examples/TokenAirdrop/main.swift @@ -2,14 +2,14 @@ import Foundation import Hiero +import HieroExampleUtilities import SwiftDotenv @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) - client.setOperator(env.operatorAccountId, env.operatorKey) let privateKey1 = PrivateKey.generateEcdsa() @@ -255,22 +255,3 @@ internal enum Program { print("Token airdrop example completed successfully") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/TokenUpdateMetadata/main.swift b/Examples/TokenUpdateMetadata/main.swift index 3fde11eb..a5d8b866 100644 --- a/Examples/TokenUpdateMetadata/main.swift +++ b/Examples/TokenUpdateMetadata/main.swift @@ -20,7 +20,7 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { @@ -30,7 +30,7 @@ internal enum Program { private static let newMetadata: Data = Data([1, 2]) internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated @@ -134,22 +134,3 @@ internal enum Program { print("Immutable token's metadata after update: \(tokenInfoAfterMetadataUpdate.metadata.bytes)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/TopicWithAdminKey/main.swift b/Examples/TopicWithAdminKey/main.swift index 340a2457..cdf7ce90 100644 --- a/Examples/TopicWithAdminKey/main.swift +++ b/Examples/TopicWithAdminKey/main.swift @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // Defaults the operator account ID and key such that all generated transactions will be paid for @@ -75,22 +75,3 @@ internal enum Program { print(topicInfo) } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/TransferCrypto/main.swift b/Examples/TransferCrypto/main.swift index 7e9300e8..138972ef 100644 --- a/Examples/TransferCrypto/main.swift +++ b/Examples/TransferCrypto/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = Client.forTestnet() client.setOperator(env.operatorAccountId, env.operatorKey) @@ -25,22 +25,3 @@ internal enum Program { print("transaction hash: \(transactionResponse.transactionHash)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/TransferTokens/main.swift b/Examples/TransferTokens/main.swift index 6b7a4a1b..df6903a4 100644 --- a/Examples/TransferTokens/main.swift +++ b/Examples/TransferTokens/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) let operatorKey = env.operatorKey @@ -156,22 +156,3 @@ internal enum Program { print("deleted accountId\(accountNumber): \(accountId)") } } - -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Examples/UpdateAccountPublicKey/main.swift b/Examples/UpdateAccountPublicKey/main.swift index 3ee7cd4f..d5bf261f 100644 --- a/Examples/UpdateAccountPublicKey/main.swift +++ b/Examples/UpdateAccountPublicKey/main.swift @@ -1,11 +1,11 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) client.setOperator(env.operatorAccountId, env.operatorKey) @@ -50,21 +50,21 @@ internal enum Program { } } -extension Environment { - /// Account ID for the operator to use in this example. - internal var operatorAccountId: AccountId { - AccountId(self["OPERATOR_ID"]!.stringValue)! - } - - /// Private key for the operator to use in this example. - internal var operatorKey: PrivateKey { - PrivateKey(self["OPERATOR_KEY"]!.stringValue)! - } - - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} +// extension Environment { +// /// Account ID for the operator to use in this example. +// internal var operatorAccountId: AccountId { +// AccountId(self["OPERATOR_ID"]!.stringValue)! +// } + +// /// Private key for the operator to use in this example. +// internal var operatorKey: PrivateKey { +// PrivateKey(self["OPERATOR_KEY"]!.stringValue)! +// } + +// /// The name of the hedera network this example should be ran against. +// /// +// /// Testnet by default. +// internal var networkName: String { +// self["HEDERA_NETWORK"]?.stringValue ?? "testnet" +// } +// } diff --git a/Examples/ValidateChecksum/main.swift b/Examples/ValidateChecksum/main.swift index 8e17304c..95b9fd60 100644 --- a/Examples/ValidateChecksum/main.swift +++ b/Examples/ValidateChecksum/main.swift @@ -2,12 +2,12 @@ import Foundation import Hiero -import SwiftDotenv +import HieroExampleUtilities @main internal enum Program { internal static func main() async throws { - let env = try Dotenv.load() + let env = try Environment.load() let client = try Client.forName(env.networkName) // we need to return _something_ to say if stdin has been EOFed on us. @@ -97,12 +97,3 @@ internal enum Program { } } } - -extension Environment { - /// The name of the hedera network this example should be ran against. - /// - /// Testnet by default. - internal var networkName: String { - self["HEDERA_NETWORK"]?.stringValue ?? "testnet" - } -} diff --git a/Package.resolved b/Package.resolved index c9ffea01..384e04c6 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swift-server/async-http-client.git", "state" : { - "revision" : "5ccda442f103792d67680aefc8d0a87392fbd66c", - "version" : "1.20.0" + "revision" : "333f51104b75d1a5b94cb3b99e4c58a3b442c9f7", + "version" : "1.25.2" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/grpc/grpc-swift.git", "state" : { - "revision" : "6a90b7e77e29f9bda6c2b3a4165a40d6c02cfda1", - "version" : "1.23.0" + "revision" : "c4d6281784f50bf2e60d3af45e83be1194056062", + "version" : "2.1.2" } }, { @@ -86,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/GigaBitcoin/secp256k1.swift.git", "state" : { - "revision" : "1a14e189def5eaa92f839afdd2faad8e43b61a6e", - "version" : "0.12.2" + "revision" : "6c50e65ec9959d9ab0039df9ffc31707ad19c01b", + "version" : "0.18.1" } }, { @@ -104,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-asn1.git", "state" : { - "revision" : "eb11d30c1de3b896f55aefdb3745dd5e7e1f319f", - "version" : "0.3.0" + "revision" : "ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf", + "version" : "1.3.1" } }, { @@ -122,8 +122,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307", - "version" : "1.0.5" + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" } }, { @@ -135,19 +135,37 @@ "version" : "3.4.0" } }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", + "version" : "1.3.3" + } + }, + { + "identity" : "swift-distributed-tracing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-distributed-tracing.git", + "state" : { + "revision" : "a64a0abc2530f767af15dd88dda7f64d5f1ff9de", + "version" : "1.2.0" + } + }, { "identity" : "swift-docc-plugin", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-docc-plugin", "state" : { - "revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", - "version" : "1.3.0" + "revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", + "version" : "1.4.3" } }, { "identity" : "swift-docc-symbolkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-symbolkit", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", "state" : { "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", "version" : "1.0.0" @@ -158,8 +176,26 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/thebarndog/swift-dotenv.git", "state" : { - "revision" : "4a3a8affd8b02be23e3fc5151a5cbd1770456cfc", - "version" : "1.2.0" + "revision" : "d13062940a3cdb2b13efa22ecc83b07b21c2e8dc", + "version" : "2.1.0" + } + }, + { + "identity" : "swift-http-structured-headers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-structured-headers.git", + "state" : { + "revision" : "8e769facea6b7d46ea60e5e93635a384fd573480", + "version" : "1.2.1" + } + }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types.git", + "state" : { + "revision" : "a0a57e949a8903563aba4615869310c0ebf14c03", + "version" : "1.4.0" } }, { @@ -176,8 +212,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-metrics.git", "state" : { - "revision" : "ce594e71e92a1610015017f83f402894df540e51", - "version" : "2.4.4" + "revision" : "44491db7cc66774ab930cf15f36324e16b06f425", + "version" : "2.6.1" } }, { @@ -185,8 +221,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "e5a216ba89deba84356bad9d4c2eab99071c745b", - "version" : "2.67.0" + "revision" : "c51907a839e63ebf0ba2076bba73dd96436bd1b9", + "version" : "2.81.0" } }, { @@ -194,8 +230,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "fb70a0f5e984f23be48b11b4f1909f3bee016178", - "version" : "1.19.1" + "revision" : "00f3f72d2f9942d0e2dc96057ab50a37ced150d4", + "version" : "1.25.0" } }, { @@ -212,8 +248,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "320bd978cceb8e88c125dcbb774943a92f6286e9", - "version" : "2.25.0" + "revision" : "0cc3528ff48129d64ab9cab0b1cd621634edfc6b", + "version" : "2.29.3" } }, { @@ -252,19 +288,28 @@ "version" : "1.29.0" } }, + { + "identity" : "swift-service-context", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-service-context.git", + "state" : { + "revision" : "8946c930cae601452149e45d31d8ddfac973c3c7", + "version" : "1.2.0" + } + }, { "identity" : "swift-snapshot-testing", "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing.git", "state" : { - "revision" : "5b356adceabff6ca027f6574aac79e9fee145d26", - "version" : "1.14.1" + "revision" : "1be8144023c367c5de701a6313ed29a3a10bf59b", + "version" : "1.18.3" } }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", + "location" : "https://github.com/swiftlang/swift-syntax", "state" : { "revision" : "64889f0c732f210a935a0ad7cda38f77f876262d", "version" : "509.1.1" @@ -275,8 +320,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5", - "version" : "1.3.2" + "revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1", + "version" : "1.4.2" } }, { @@ -284,8 +329,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/vapor.git", "state" : { - "revision" : "f1c3495b5c35ab67881412acf20144112729b560", - "version" : "4.101.3" + "revision" : "87b0edd2633c35de543cb7573efe5fbf456181bc", + "version" : "4.114.1" } }, { @@ -296,6 +341,15 @@ "revision" : "4232d34efa49f633ba61afde365d3896fc7f8740", "version" : "2.15.0" } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "39de59b2d47f7ef3ca88a039dff3084688fe27f4", + "version" : "1.5.2" + } } ], "version" : 2 diff --git a/Package.swift b/Package.swift index 42bf73ec..a7552fac 100644 --- a/Package.swift +++ b/Package.swift @@ -1,24 +1,6 @@ -// swift-tools-version:5.6 +// swift-tools-version:5.9 -/* - * ‌ - * Hedera Swift SDK - * ​ - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ +// SPDX-License-Identifier: Apache-2.0 import PackageDescription @@ -84,27 +66,25 @@ let exampleTargets = [ let package = Package( name: "Hiero", platforms: [ - .macOS(.v10_15), + .macOS(.v14), .iOS(.v13), ], products: [ .library(name: "Hiero", targets: ["Hiero"]) ], dependencies: [ - .package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.5.1"), - .package(url: "https://github.com/thebarndog/swift-dotenv.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.23.0"), - .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.29.0"), - .package(url: "https://github.com/vsanthanam/AnyAsyncSequence.git", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"), - // swift-asn1 wants swift 5.7+ past 0.4 - .package(url: "https://github.com/apple/swift-asn1.git", .upToNextMinor(from: "0.3.0")), - .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", .upToNextMinor(from: "0.12.0")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.0.0"), - .package(url: "https://github.com/vapor/vapor.git", from: "4.101.3"), - .package(url: "https://github.com/attaswift/BigInt.git", from: "5.2.0"), - // Currently, only used for keccak256 + .package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.6.0"), + .package(url: "https://github.com/thebarndog/swift-dotenv.git", from: "2.1.0"), + .package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"), + .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.28.2"), + .package(url: "https://github.com/vsanthanam/AnyAsyncSequence.git", from: "1.0.2"), + .package(url: "https://github.com/apple/swift-atomics.git", from: "1.2.0"), + .package(url: "https://github.com/apple/swift-asn1.git", from: "1.3.1"), + .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", from: "0.18.0"), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.3"), + .package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.18.0"), + .package(url: "https://github.com/vapor/vapor.git", from: "4.112.0"), + .package(url: "https://github.com/attaswift/BigInt.git", from: "5.5.1"), .package(url: "https://github.com/krzyzanowskim/OpenSSL-Package.git", from: "3.3.2000"), ], targets: [ @@ -112,16 +92,16 @@ let package = Package( name: "HieroProtobufs", dependencies: [ .product(name: "SwiftProtobuf", package: "swift-protobuf"), - .product(name: "GRPC", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift"), ], exclude: [ "Protos", "update_protos.py", ] ), - // weird name, but whatever, internal targets .target( name: "HieroExampleUtilities", + dependencies: ["Hiero"], resources: [.process("Resources")] ), .target( @@ -132,16 +112,12 @@ let package = Package( .product(name: "SwiftASN1", package: "swift-asn1"), .product(name: "SwiftProtobuf", package: "swift-protobuf"), .product(name: "NumberKit", package: "swift-numberkit"), - .product(name: "GRPC", package: "grpc-swift"), + .product(name: "GRPCCore", package: "grpc-swift"), .product(name: "Atomics", package: "swift-atomics"), .product(name: "secp256k1", package: "secp256k1.swift"), .product(name: "BigInt", package: "BigInt"), .product(name: "OpenSSL", package: "OpenSSL-Package"), ] - // todo: find some way to enable these locally. - // swiftSettings: [ - // .unsafeFlags(["-Xfrontend", "-warn-concurrency", "-Xfrontend", "-enable-actor-data-race-checks"]) - // ] ), .executableTarget( name: "HieroTCK", diff --git a/README.md b/README.md index 8deaf34d..f1ae070f 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,11 @@ HieroProtobufs are entirely generated. ### Required Tooling -protoc -protoc-gen-swift (from https://github.com/apple/swift-protobuf) -protoc-gen-grpc-swift (from https://github.com/grpc/grpc-swift) -task (from https://github.com/go-task/task) -openSSL 3.4 (from https://openssl-library.org/source/) +- protoc +- protoc-gen-swift (from https://github.com/apple/swift-protobuf) +- protoc-gen-grpc-swift (from https://github.com/grpc/grpc-swift) +- task (from https://github.com/go-task/task) +- openSSL 3.4 (from https://openssl-library.org/source/) ### Fetch Submodule and Generate Swift Protobufs (HieroProtobufs) diff --git a/Sources/Hiero/Crypto/Pkcs5.swift b/Sources/Hiero/Crypto/Pkcs5.swift index e7151d38..a02df589 100644 --- a/Sources/Hiero/Crypto/Pkcs5.swift +++ b/Sources/Hiero/Crypto/Pkcs5.swift @@ -61,14 +61,14 @@ extension Pkcs5.EncryptionScheme: DERImplicitlyTaggable { let algId = try Pkcs5.AlgorithmIdentifier(derEncoded: derEncoded, withIdentifier: identifier) guard let parameters = algId.parameters else { - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "HMAC algorithm requires NULL parameters") } switch algId.oid { case .AlgorithmIdentifier.pbes2: self = .pbes2(try Pkcs5.Pbes2Parameters(asn1Any: parameters)) default: - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "unsupported algorithm identifier: \(algId.oid)") } } diff --git a/Sources/Hiero/Crypto/Pkcs5Pbes2.swift b/Sources/Hiero/Crypto/Pkcs5Pbes2.swift index 7244fc85..0cc421e9 100644 --- a/Sources/Hiero/Crypto/Pkcs5Pbes2.swift +++ b/Sources/Hiero/Crypto/Pkcs5Pbes2.swift @@ -42,14 +42,14 @@ extension Pkcs5.Pbes2Kdf: DERImplicitlyTaggable { let algId = try Pkcs5.AlgorithmIdentifier(derEncoded: derEncoded, withIdentifier: identifier) guard let params = algId.parameters else { - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "PBES2 requires key derivation and encryption parameters") } switch algId.oid { case .AlgorithmIdentifier.pbkdf2: self = .pbkdf2(try Pkcs5.Pbkdf2Parameters(asn1Any: params)) default: - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "unsupported algorithm identifier: \(algId.oid)") } } @@ -82,19 +82,19 @@ extension Pkcs5.Pbes2EncryptionScheme: DERImplicitlyTaggable { let algId = try Pkcs5.AlgorithmIdentifier(derEncoded: derEncoded, withIdentifier: identifier) guard let params = algId.parameters else { - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "PBES2 requires key derivation and encryption parameters") } switch algId.oid { case .AlgorithmIdentifier.aes128CbcPad: let params = try ASN1OctetString(asn1Any: params) guard params.bytes.count == 16 else { - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "AES-128-CBC requires a 16-byte initialization vector") } self = .aes128Cbc(Data(params.bytes)) default: - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "unsupported algorithm identifier: \(algId.oid)") } } diff --git a/Sources/Hiero/Crypto/Pkcs5Pbkdf2.swift b/Sources/Hiero/Crypto/Pkcs5Pbkdf2.swift index fc53da68..9fa06836 100644 --- a/Sources/Hiero/Crypto/Pkcs5Pbkdf2.swift +++ b/Sources/Hiero/Crypto/Pkcs5Pbkdf2.swift @@ -172,7 +172,7 @@ extension Pkcs5.Pbkdf2Prf: DERImplicitlyTaggable { // these specifically want `null` as in, not missing. guard let params = algId.parameters else { - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object(reason: "HMAC algorithm requires NULL parameters") } _ = try ASN1Null(asn1Any: params) @@ -183,7 +183,7 @@ extension Pkcs5.Pbkdf2Prf: DERImplicitlyTaggable { case .DigestAlgorithm.hmacWithSha256: self = .hmacWithSha256 case .DigestAlgorithm.hmacWithSha384: self = .hmacWithSha384 case .DigestAlgorithm.hmacWithSha512: self = .hmacWithSha512 - default: throw ASN1Error.invalidASN1Object + default: throw ASN1Error.invalidASN1Object(reason: "unsupported algorithm identifier: \(algId.oid)") } } @@ -210,7 +210,10 @@ extension Pkcs5.Pbkdf2Parameters: DERImplicitlyTaggable { guard let value = Self(salt: Data(salt.bytes), iterationCount: iterationCount, keyLength: keyLength, prf: prf) else { - throw ASN1Error.invalidASN1Object + throw ASN1Error.invalidASN1Object( + reason: + "Invalid PBKDF2 parameters: iteration count must be between 1 and 10,000,000, and key length must be at least 1 if specified" + ) } return value diff --git a/Sources/Hiero/Crypto/Pkcs8.swift b/Sources/Hiero/Crypto/Pkcs8.swift index 17af5371..5a78f0f5 100644 --- a/Sources/Hiero/Crypto/Pkcs8.swift +++ b/Sources/Hiero/Crypto/Pkcs8.swift @@ -112,8 +112,7 @@ extension Pkcs8.Version: DERImplicitlyTaggable { let raw = try Int(derEncoded: derEncoded, withIdentifier: identifier) guard let value = Self(rawValue: raw) else { - throw ASN1Error.invalidASN1Object - // throw ASN1Error.invalidASN1Object(reason: "invalid Pkcs8.Version") + throw ASN1Error.invalidASN1Object(reason: "invalid Pkcs8.Version") } self = value @@ -149,8 +148,7 @@ extension Pkcs8.PrivateKeyInfo: DERImplicitlyTaggable { switch (version, publicKey != nil) { case (.v1, false), (.v2, true): break case (.v1, true), (.v2, false): - throw ASN1Error.invalidASN1Object - // throw ASN1Error.invalidASN1Object(reason: "invalid version, public key combo") + throw ASN1Error.invalidASN1Object(reason: "invalid version, public key combo") } return Self(algorithm: algorithmIdentifier, privateKey: privateKey, publicKey: publicKey) diff --git a/Sources/Hiero/Crypto/Sec1.swift b/Sources/Hiero/Crypto/Sec1.swift index c68da33d..8e4526ca 100644 --- a/Sources/Hiero/Crypto/Sec1.swift +++ b/Sources/Hiero/Crypto/Sec1.swift @@ -53,8 +53,7 @@ extension Sec1.Version: DERImplicitlyTaggable { let raw = try Int(derEncoded: derEncoded, withIdentifier: identifier) guard let value = Self(rawValue: raw) else { - throw ASN1Error.invalidASN1Object - // throw ASN1Error.invalidASN1Object(reason: "invalid Pkcs8.Version") + throw ASN1Error.invalidASN1Object(reason: "invalid Sec1.Version: \(raw)") } self = value diff --git a/Sources/Hiero/PrivateKey.swift b/Sources/Hiero/PrivateKey.swift index f87c2cc6..799d632e 100644 --- a/Sources/Hiero/PrivateKey.swift +++ b/Sources/Hiero/PrivateKey.swift @@ -24,8 +24,11 @@ internal struct Keccak256Digest: Crypto.SecpDigest { } } +/// A chain code used in hierarchical deterministic (HD) key derivation. +/// This is used to derive child keys from a parent key in a deterministic way. public struct ChainCode { - let data: Data + /// The data representing the chain code. + public let data: Data } #if compiler(>=5.7) diff --git a/Sources/HieroExampleUtilities/Environment.swift b/Sources/HieroExampleUtilities/Environment.swift new file mode 100644 index 00000000..d07d3c5e --- /dev/null +++ b/Sources/HieroExampleUtilities/Environment.swift @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: Apache-2.0 + +import Foundation +import Hiero +import SwiftDotenv + +/// Environment configuration for Hiero examples +public struct Environment { + /// The name of the Hedera network to connect to + public let networkName: String + + /// The account ID of the operator + public let operatorAccountId: AccountId + + /// The private key of the operator + public let operatorKey: PrivateKey + + /// The file ID of the exchange rates + public let exchangeRatesFile: FileId + + /// Loads environment variables from .env file + /// - Returns: Environment configuration + /// - Throws: Error if required environment variables are missing + public static func load() throws -> Environment { + try Dotenv.configure() + let networkName: String = Dotenv.processInfo.environment["HEDERA_NETWORK"] ?? "testnet" + let operatorAccountId = AccountId(Dotenv.processInfo.environment["OPERATOR_ID"]!)! + let operatorKey = PrivateKey(Dotenv.processInfo.environment["OPERATOR_KEY"]!)! + let exchangeRatesFile = FileId(Dotenv.processInfo.environment["HEDERA_EXCHANGE_RATES_FILE"] ?? "0.0.1000")! + return Environment( + networkName: networkName, operatorAccountId: operatorAccountId, operatorKey: operatorKey, + exchangeRatesFile: exchangeRatesFile) + } +} diff --git a/Sources/HieroProtobufs/Generated/mirror/mirror_network_service.grpc.swift b/Sources/HieroProtobufs/Generated/mirror/mirror_network_service.grpc.swift index 58726c36..e2b5569a 100644 --- a/Sources/HieroProtobufs/Generated/mirror/mirror_network_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/mirror/mirror_network_service.grpc.swift @@ -1,326 +1,373 @@ -// // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: mirror/mirror_network_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// Provides cross network APIs like address book queries -/// -/// Usage: instantiate `Com_Hedera_Mirror_Api_Proto_NetworkServiceClient`, then call methods of this protocol to make API calls. -public protocol Com_Hedera_Mirror_Api_Proto_NetworkServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? { get } - - func getNodes( - _ request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, - callOptions: CallOptions?, - handler: @escaping (Proto_NodeAddress) -> Void - ) -> ServerStreamingCall -} - -extension Com_Hedera_Mirror_Api_Proto_NetworkServiceClientProtocol { - public var serviceName: String { - return "com.hedera.mirror.api.proto.NetworkService" - } - - /// - /// Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The - /// response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on - /// the network since it is reconstructed from a normalized database table. - /// - /// - Parameters: - /// - request: Request to send to getNodes. - /// - callOptions: Call options. - /// - handler: A closure called when each response is received from the server. - /// - Returns: A `ServerStreamingCall` with futures for the metadata and status. - public func getNodes( - _ request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, - callOptions: CallOptions? = nil, - handler: @escaping (Proto_NodeAddress) -> Void - ) -> ServerStreamingCall { - return self.makeServerStreamingCall( - path: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientMetadata.Methods.getNodes.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNodesInterceptors() ?? [], - handler: handler - ) - } -} - -@available(*, deprecated) -extension Com_Hedera_Mirror_Api_Proto_NetworkServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Com_Hedera_Mirror_Api_Proto_NetworkServiceNIOClient") -public final class Com_Hedera_Mirror_Api_Proto_NetworkServiceClient: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the com.hedera.mirror.api.proto.NetworkService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -public struct Com_Hedera_Mirror_Api_Proto_NetworkServiceNIOClient: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the com.hedera.mirror.api.proto.NetworkService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -///* -/// Provides cross network APIs like address book queries -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? { get } - - func makeGetNodesCall( - _ request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, - callOptions: CallOptions? - ) -> GRPCAsyncServerStreamingCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Com_Hedera_Mirror_Api_Proto_NetworkServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeGetNodesCall( - _ request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, - callOptions: CallOptions? = nil - ) -> GRPCAsyncServerStreamingCall { - return self.makeAsyncServerStreamingCall( - path: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientMetadata.Methods.getNodes.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNodesInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncClientProtocol { - public func getNodes( - _ request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, - callOptions: CallOptions? = nil - ) -> GRPCAsyncResponseStream { - return self.performAsyncServerStreamingCall( - path: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientMetadata.Methods.getNodes.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNodesInterceptors() ?? [] - ) - } +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - com.hedera.mirror.api.proto.NetworkService + +/// Namespace containing generated types for the "com.hedera.mirror.api.proto.NetworkService" service. +public enum Com_Hedera_Mirror_Api_Proto_NetworkService { + /// Service descriptor for the "com.hedera.mirror.api.proto.NetworkService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "com.hedera.mirror.api.proto.NetworkService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "getNodes" metadata. + public enum getNodes { + /// Request type for "getNodes". + public typealias Input = Com_Hedera_Mirror_Api_Proto_AddressBookQuery + /// Response type for "getNodes". + public typealias Output = Proto_NodeAddress + /// Descriptor for "getNodes". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "com.hedera.mirror.api.proto.NetworkService"), + method: "getNodes" + ) + } + /// Descriptors for all methods in the "com.hedera.mirror.api.proto.NetworkService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + getNodes.descriptor + ] + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncClient: Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "com.hedera.mirror.api.proto.NetworkService" service. + public static let com_hedera_mirror_api_proto_NetworkService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "com.hedera.mirror.api.proto.NetworkService") } -public protocol Com_Hedera_Mirror_Api_Proto_NetworkServiceClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'getNodes'. - func makegetNodesInterceptors() -> [ClientInterceptor] -} +// MARK: com.hedera.mirror.api.proto.NetworkService (server) + +extension Com_Hedera_Mirror_Api_Proto_NetworkService { + /// Streaming variant of the service protocol for the "com.hedera.mirror.api.proto.NetworkService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Provides cross network APIs like address book queries + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - request: A streaming request of `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_NodeAddress` messages. + func getNodes( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public enum Com_Hedera_Mirror_Api_Proto_NetworkServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "NetworkService", - fullName: "com.hedera.mirror.api.proto.NetworkService", - methods: [ - Com_Hedera_Mirror_Api_Proto_NetworkServiceClientMetadata.Methods.getNodes, - ] - ) + /// Service protocol for the "com.hedera.mirror.api.proto.NetworkService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Provides cross network APIs like address book queries + public protocol ServiceProtocol: Com_Hedera_Mirror_Api_Proto_NetworkService.StreamingServiceProtocol { + /// Handle the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - request: A request containing a single `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_NodeAddress` messages. + func getNodes( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } - public enum Methods { - public static let getNodes = GRPCMethodDescriptor( - name: "getNodes", - path: "/com.hedera.mirror.api.proto.NetworkService/getNodes", - type: GRPCCallType.serverStreaming - ) - } + /// Simple service protocol for the "com.hedera.mirror.api.proto.NetworkService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Provides cross network APIs like address book queries + public protocol SimpleServiceProtocol: Com_Hedera_Mirror_Api_Proto_NetworkService.ServiceProtocol { + /// Handle the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - request: A `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` message. + /// - response: A response stream of `Proto_NodeAddress` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + func getNodes( + request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, + response: GRPCCore.RPCWriter, + context: GRPCCore.ServerContext + ) async throws + } } -///* -/// Provides cross network APIs like address book queries -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Com_Hedera_Mirror_Api_Proto_NetworkServiceProvider: CallHandlerProvider { - var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceServerInterceptorFactoryProtocol? { get } - - /// - /// Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The - /// response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on - /// the network since it is reconstructed from a normalized database table. - func getNodes(request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, context: StreamingResponseCallContext) -> EventLoopFuture +// Default implementation of 'registerMethods(with:)'. +extension Com_Hedera_Mirror_Api_Proto_NetworkService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Com_Hedera_Mirror_Api_Proto_NetworkService.Method.getNodes.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getNodes( + request: request, + context: context + ) + } + ) + } } -extension Com_Hedera_Mirror_Api_Proto_NetworkServiceProvider { - public var serviceName: Substring { - return Com_Hedera_Mirror_Api_Proto_NetworkServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "getNodes": - return ServerStreamingServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNodesInterceptors() ?? [], - userFunction: self.getNodes(request:context:) - ) - - default: - return nil +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Com_Hedera_Mirror_Api_Proto_NetworkService.ServiceProtocol { + public func getNodes( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getNodes( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return response } - } } -///* -/// Provides cross network APIs like address book queries -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceServerInterceptorFactoryProtocol? { get } - - /// - /// Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The - /// response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on - /// the network since it is reconstructed from a normalized database table. - func getNodes( - request: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, - responseStream: GRPCAsyncResponseStreamWriter, - context: GRPCAsyncServerCallContext - ) async throws +// Default implementation of methods from 'ServiceProtocol'. +extension Com_Hedera_Mirror_Api_Proto_NetworkService.SimpleServiceProtocol { + public func getNodes( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + return GRPCCore.StreamingServerResponse( + metadata: [:], + producer: { writer in + try await self.getNodes( + request: request.message, + response: writer, + context: context + ) + return [:] + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Com_Hedera_Mirror_Api_Proto_NetworkServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Com_Hedera_Mirror_Api_Proto_NetworkServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Com_Hedera_Mirror_Api_Proto_NetworkServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Com_Hedera_Mirror_Api_Proto_NetworkServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "getNodes": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNodesInterceptors() ?? [], - wrapping: { try await self.getNodes(request: $0, responseStream: $1, context: $2) } - ) +// MARK: com.hedera.mirror.api.proto.NetworkService (client) + +extension Com_Hedera_Mirror_Api_Proto_NetworkService { + /// Generated client protocol for the "com.hedera.mirror.api.proto.NetworkService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Provides cross network APIs like address book queries + public protocol ClientProtocol: Sendable { + /// Call the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - request: A request containing a single `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` message. + /// - serializer: A serializer for `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` messages. + /// - deserializer: A deserializer for `Proto_NodeAddress` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getNodes( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } - default: - return nil + /// Generated client for the "com.hedera.mirror.api.proto.NetworkService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Provides cross network APIs like address book queries + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - request: A request containing a single `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` message. + /// - serializer: A serializer for `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` messages. + /// - deserializer: A deserializer for `Proto_NodeAddress` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getNodes( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable { + try await self.client.serverStreaming( + request: request, + descriptor: Com_Hedera_Mirror_Api_Proto_NetworkService.Method.getNodes.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } } - } } -public protocol Com_Hedera_Mirror_Api_Proto_NetworkServiceServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'getNodes'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetNodesInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Com_Hedera_Mirror_Api_Proto_NetworkService.ClientProtocol { + /// Call the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - request: A request containing a single `Com_Hedera_Mirror_Api_Proto_AddressBookQuery` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getNodes( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable { + try await self.getNodes( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } -public enum Com_Hedera_Mirror_Api_Proto_NetworkServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "NetworkService", - fullName: "com.hedera.mirror.api.proto.NetworkService", - methods: [ - Com_Hedera_Mirror_Api_Proto_NetworkServiceServerMetadata.Methods.getNodes, - ] - ) - - public enum Methods { - public static let getNodes = GRPCMethodDescriptor( - name: "getNodes", - path: "/com.hedera.mirror.api.proto.NetworkService/getNodes", - type: GRPCCallType.serverStreaming - ) - } -} +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Com_Hedera_Mirror_Api_Proto_NetworkService.ClientProtocol { + /// Call the "getNodes" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The + /// > response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on + /// > the network since it is reconstructed from a normalized database table. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getNodes( + _ message: Com_Hedera_Mirror_Api_Proto_AddressBookQuery, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getNodes( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/platform/event/state_signature_transaction.grpc.swift b/Sources/HieroProtobufs/Generated/platform/event/state_signature_transaction.grpc.swift new file mode 100644 index 00000000..21364bb1 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/platform/event/state_signature_transaction.grpc.swift @@ -0,0 +1,19 @@ +///* +/// # State Signature Transaction +/// An signature of a state snapshot gossiped to other nodes. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: platform/event/state_signature_transaction.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/sdk/transaction_list.grpc.swift b/Sources/HieroProtobufs/Generated/sdk/transaction_list.grpc.swift new file mode 100644 index 00000000..2ac6928b --- /dev/null +++ b/Sources/HieroProtobufs/Generated/sdk/transaction_list.grpc.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: sdk/transaction_list.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/address_book_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/address_book_service.grpc.swift index 23a7fe6c..32fc30f1 100644 --- a/Sources/HieroProtobufs/Generated/services/address_book_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/address_book_service.grpc.swift @@ -1,885 +1,1347 @@ -// +///* +/// # Address Book Service API +/// GRPC service definitions for the Hedera Address Book Service (HABS). +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/address_book_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// The Address Book service provides the ability for Hedera network node -/// administrators to add, update, and remove consensus nodes. This addition, -/// update, or removal of a consensus node requires governing council approval, -/// but each node operator may update their own operational attributes without -/// additional approval, reducing overhead for routine operations. -/// -/// Most operations are `privileged operations` and require governing council -/// approval. -/// -/// ### For a node creation transaction. -/// - The node operator SHALL create a `createNode` transaction. -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the new `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node creation transaction the network -/// software SHALL -/// - Validate the threshold signature for the Hedera governing council -/// - Validate the signature of the `Key` provided as the new `admin_key` -/// for the `Node`. -/// - Create the new node in state, this new node SHALL NOT be active in the -/// network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and bring the -/// new node to an active status within the network. The node to be added -/// SHALL be active in the network following this upgrade. -/// -/// ### For a node deletion transaction. -/// - The node operator or Hedera council representative SHALL create a -/// `deleteNode` transaction. -/// - If the node operator creates the transaction -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the existing `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node deletion transaction the network -/// software SHALL -/// - Validate the signature for the Hedera governing council -/// - Remove the existing node from network state. The node SHALL still -/// be active in the network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and remove the -/// node to be deleted from the network. The node to be deleted SHALL NOT -/// be active in the network following this upgrade. -/// -/// ### For a node update transaction. -/// - The node operator SHALL create an `updateNode` transaction. -/// - The node operator MUST sign this transaction with the active `key` -/// assigned as the `admin_key`. -/// - The node operator SHALL submit the transaction to the -/// network. Hedera council approval SHALL NOT be sought for this -/// transaction -/// - Upon receipt of a valid and signed node update transaction the network -/// software SHALL -/// - If the transaction modifies the value of the "node account", -/// - Validate the signature of the active `key` for the account -/// assigned as the _current_ "node account". -/// - Validate the signature of the active `key` for the account to be -/// assigned as the _new_ "node account". -/// - Modify the node information held in network state with the changes -/// requested in the update transaction. The node changes SHALL NOT be -/// applied to network configuration, and SHALL NOT affect network -/// operation at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration according to the -/// modified information in network state. The requested changes SHALL -/// affect network operation following this upgrade. -/// -/// Usage: instantiate `Proto_AddressBookServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_AddressBookServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? { get } - - func createNode( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteNode( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateNode( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.AddressBookService + +/// Namespace containing generated types for the "proto.AddressBookService" service. +public enum Proto_AddressBookService { + /// Service descriptor for the "proto.AddressBookService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.AddressBookService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createNode" metadata. + public enum createNode { + /// Request type for "createNode". + public typealias Input = Proto_Transaction + /// Response type for "createNode". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createNode". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.AddressBookService"), + method: "createNode" + ) + } + /// Namespace for "deleteNode" metadata. + public enum deleteNode { + /// Request type for "deleteNode". + public typealias Input = Proto_Transaction + /// Response type for "deleteNode". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteNode". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.AddressBookService"), + method: "deleteNode" + ) + } + /// Namespace for "updateNode" metadata. + public enum updateNode { + /// Request type for "updateNode". + public typealias Input = Proto_Transaction + /// Response type for "updateNode". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateNode". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.AddressBookService"), + method: "updateNode" + ) + } + /// Descriptors for all methods in the "proto.AddressBookService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createNode.descriptor, + deleteNode.descriptor, + updateNode.descriptor + ] + } } -extension Proto_AddressBookServiceClientProtocol { - public var serviceName: String { - return "proto.AddressBookService" - } - - ///* - /// A transaction to create a new consensus node in the network - /// address book. - ///

- /// This transaction, once complete, SHALL add a new consensus node to the - /// network state.
- /// The new consensus node SHALL remain in state, but SHALL NOT participate - /// in network consensus until the network updates the network configuration. - ///

- /// Hedera governing council authorization is REQUIRED for this transaction. - /// - /// - Parameters: - /// - request: Request to send to createNode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createNode( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.createNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateNodeInterceptors() ?? [] - ) - } - - ///* - /// A transaction to remove a consensus node from the network address - /// book. - ///

- /// This transaction, once complete, SHALL remove the identified consensus - /// node from the network state. - ///

- /// Hedera governing council authorization is REQUIRED for this transaction. - /// - /// - Parameters: - /// - request: Request to send to deleteNode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteNode( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.deleteNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteNodeInterceptors() ?? [] - ) - } - - ///* - /// A transaction to update an existing consensus node from the network - /// address book. - ///

- /// This transaction, once complete, SHALL modify the identified consensus - /// node state as requested. - ///

- /// This transaction is authorized by the node operator - /// - /// - Parameters: - /// - request: Request to send to updateNode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateNode( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.updateNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateNodeInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.AddressBookService" service. + public static let proto_AddressBookService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.AddressBookService") } -@available(*, deprecated) -extension Proto_AddressBookServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_AddressBookServiceNIOClient") -public final class Proto_AddressBookServiceClient: Proto_AddressBookServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.AddressBookService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.AddressBookService (server) + +extension Proto_AddressBookService { + /// Streaming variant of the service protocol for the "proto.AddressBookService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Address Book service provides the ability for Hedera network node + /// > administrators to add, update, and remove consensus nodes. This addition, + /// > update, or removal of a consensus node requires governing council approval, + /// > but each node operator may update their own operational attributes without + /// > additional approval, reducing overhead for routine operations. + /// > + /// > Most operations are `privileged operations` and require governing council + /// > approval. + /// > + /// > ### For a node creation transaction. + /// > - The node operator SHALL create a `createNode` transaction. + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the new `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node creation transaction the network + /// > software SHALL + /// > - Validate the threshold signature for the Hedera governing council + /// > - Validate the signature of the `Key` provided as the new `admin_key` + /// > for the `Node`. + /// > - Create the new node in state, this new node SHALL NOT be active in the + /// > network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and bring the + /// > new node to an active status within the network. The node to be added + /// > SHALL be active in the network following this upgrade. + /// > + /// > ### For a node deletion transaction. + /// > - The node operator or Hedera council representative SHALL create a + /// > `deleteNode` transaction. + /// > - If the node operator creates the transaction + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the existing `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node deletion transaction the network + /// > software SHALL + /// > - Validate the signature for the Hedera governing council + /// > - Remove the existing node from network state. The node SHALL still + /// > be active in the network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and remove the + /// > node to be deleted from the network. The node to be deleted SHALL NOT + /// > be active in the network following this upgrade. + /// > + /// > ### For a node update transaction. + /// > - The node operator SHALL create an `updateNode` transaction. + /// > - The node operator MUST sign this transaction with the active `key` + /// > assigned as the `admin_key`. + /// > - The node operator SHALL submit the transaction to the + /// > network. Hedera council approval SHALL NOT be sought for this + /// > transaction + /// > - Upon receipt of a valid and signed node update transaction the network + /// > software SHALL + /// > - If the transaction modifies the value of the "node account", + /// > - Validate the signature of the active `key` for the account + /// > assigned as the _current_ "node account". + /// > - Validate the signature of the active `key` for the account to be + /// > assigned as the _new_ "node account". + /// > - Modify the node information held in network state with the changes + /// > requested in the update transaction. The node changes SHALL NOT be + /// > applied to network configuration, and SHALL NOT affect network + /// > operation at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration according to the + /// > modified information in network state. The requested changes SHALL + /// > affect network operation following this upgrade. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createNode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteNode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateNode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_AddressBookServiceNIOClient: Proto_AddressBookServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.AddressBookService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.AddressBookService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Address Book service provides the ability for Hedera network node + /// > administrators to add, update, and remove consensus nodes. This addition, + /// > update, or removal of a consensus node requires governing council approval, + /// > but each node operator may update their own operational attributes without + /// > additional approval, reducing overhead for routine operations. + /// > + /// > Most operations are `privileged operations` and require governing council + /// > approval. + /// > + /// > ### For a node creation transaction. + /// > - The node operator SHALL create a `createNode` transaction. + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the new `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node creation transaction the network + /// > software SHALL + /// > - Validate the threshold signature for the Hedera governing council + /// > - Validate the signature of the `Key` provided as the new `admin_key` + /// > for the `Node`. + /// > - Create the new node in state, this new node SHALL NOT be active in the + /// > network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and bring the + /// > new node to an active status within the network. The node to be added + /// > SHALL be active in the network following this upgrade. + /// > + /// > ### For a node deletion transaction. + /// > - The node operator or Hedera council representative SHALL create a + /// > `deleteNode` transaction. + /// > - If the node operator creates the transaction + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the existing `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node deletion transaction the network + /// > software SHALL + /// > - Validate the signature for the Hedera governing council + /// > - Remove the existing node from network state. The node SHALL still + /// > be active in the network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and remove the + /// > node to be deleted from the network. The node to be deleted SHALL NOT + /// > be active in the network following this upgrade. + /// > + /// > ### For a node update transaction. + /// > - The node operator SHALL create an `updateNode` transaction. + /// > - The node operator MUST sign this transaction with the active `key` + /// > assigned as the `admin_key`. + /// > - The node operator SHALL submit the transaction to the + /// > network. Hedera council approval SHALL NOT be sought for this + /// > transaction + /// > - Upon receipt of a valid and signed node update transaction the network + /// > software SHALL + /// > - If the transaction modifies the value of the "node account", + /// > - Validate the signature of the active `key` for the account + /// > assigned as the _current_ "node account". + /// > - Validate the signature of the active `key` for the account to be + /// > assigned as the _new_ "node account". + /// > - Modify the node information held in network state with the changes + /// > requested in the update transaction. The node changes SHALL NOT be + /// > applied to network configuration, and SHALL NOT affect network + /// > operation at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration according to the + /// > modified information in network state. The requested changes SHALL + /// > affect network operation following this upgrade. + public protocol ServiceProtocol: Proto_AddressBookService.StreamingServiceProtocol { + /// Handle the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createNode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteNode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateNode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// The Address Book service provides the ability for Hedera network node -/// administrators to add, update, and remove consensus nodes. This addition, -/// update, or removal of a consensus node requires governing council approval, -/// but each node operator may update their own operational attributes without -/// additional approval, reducing overhead for routine operations. -/// -/// Most operations are `privileged operations` and require governing council -/// approval. -/// -/// ### For a node creation transaction. -/// - The node operator SHALL create a `createNode` transaction. -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the new `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node creation transaction the network -/// software SHALL -/// - Validate the threshold signature for the Hedera governing council -/// - Validate the signature of the `Key` provided as the new `admin_key` -/// for the `Node`. -/// - Create the new node in state, this new node SHALL NOT be active in the -/// network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and bring the -/// new node to an active status within the network. The node to be added -/// SHALL be active in the network following this upgrade. -/// -/// ### For a node deletion transaction. -/// - The node operator or Hedera council representative SHALL create a -/// `deleteNode` transaction. -/// - If the node operator creates the transaction -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the existing `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node deletion transaction the network -/// software SHALL -/// - Validate the signature for the Hedera governing council -/// - Remove the existing node from network state. The node SHALL still -/// be active in the network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and remove the -/// node to be deleted from the network. The node to be deleted SHALL NOT -/// be active in the network following this upgrade. -/// -/// ### For a node update transaction. -/// - The node operator SHALL create an `updateNode` transaction. -/// - The node operator MUST sign this transaction with the active `key` -/// assigned as the `admin_key`. -/// - The node operator SHALL submit the transaction to the -/// network. Hedera council approval SHALL NOT be sought for this -/// transaction -/// - Upon receipt of a valid and signed node update transaction the network -/// software SHALL -/// - If the transaction modifies the value of the "node account", -/// - Validate the signature of the active `key` for the account -/// assigned as the _current_ "node account". -/// - Validate the signature of the active `key` for the account to be -/// assigned as the _new_ "node account". -/// - Modify the node information held in network state with the changes -/// requested in the update transaction. The node changes SHALL NOT be -/// applied to network configuration, and SHALL NOT affect network -/// operation at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration according to the -/// modified information in network state. The requested changes SHALL -/// affect network operation following this upgrade. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_AddressBookServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateNodeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteNodeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateNodeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.AddressBookService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Address Book service provides the ability for Hedera network node + /// > administrators to add, update, and remove consensus nodes. This addition, + /// > update, or removal of a consensus node requires governing council approval, + /// > but each node operator may update their own operational attributes without + /// > additional approval, reducing overhead for routine operations. + /// > + /// > Most operations are `privileged operations` and require governing council + /// > approval. + /// > + /// > ### For a node creation transaction. + /// > - The node operator SHALL create a `createNode` transaction. + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the new `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node creation transaction the network + /// > software SHALL + /// > - Validate the threshold signature for the Hedera governing council + /// > - Validate the signature of the `Key` provided as the new `admin_key` + /// > for the `Node`. + /// > - Create the new node in state, this new node SHALL NOT be active in the + /// > network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and bring the + /// > new node to an active status within the network. The node to be added + /// > SHALL be active in the network following this upgrade. + /// > + /// > ### For a node deletion transaction. + /// > - The node operator or Hedera council representative SHALL create a + /// > `deleteNode` transaction. + /// > - If the node operator creates the transaction + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the existing `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node deletion transaction the network + /// > software SHALL + /// > - Validate the signature for the Hedera governing council + /// > - Remove the existing node from network state. The node SHALL still + /// > be active in the network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and remove the + /// > node to be deleted from the network. The node to be deleted SHALL NOT + /// > be active in the network following this upgrade. + /// > + /// > ### For a node update transaction. + /// > - The node operator SHALL create an `updateNode` transaction. + /// > - The node operator MUST sign this transaction with the active `key` + /// > assigned as the `admin_key`. + /// > - The node operator SHALL submit the transaction to the + /// > network. Hedera council approval SHALL NOT be sought for this + /// > transaction + /// > - Upon receipt of a valid and signed node update transaction the network + /// > software SHALL + /// > - If the transaction modifies the value of the "node account", + /// > - Validate the signature of the active `key` for the account + /// > assigned as the _current_ "node account". + /// > - Validate the signature of the active `key` for the account to be + /// > assigned as the _new_ "node account". + /// > - Modify the node information held in network state with the changes + /// > requested in the update transaction. The node changes SHALL NOT be + /// > applied to network configuration, and SHALL NOT affect network + /// > operation at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration according to the + /// > modified information in network state. The requested changes SHALL + /// > affect network operation following this upgrade. + public protocol SimpleServiceProtocol: Proto_AddressBookService.ServiceProtocol { + /// Handle the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createNode( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteNode( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateNode( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_AddressBookServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_AddressBookServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateNodeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.createNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateNodeInterceptors() ?? [] - ) - } - - public func makeDeleteNodeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.deleteNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteNodeInterceptors() ?? [] - ) - } - - public func makeUpdateNodeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.updateNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateNodeInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_AddressBookService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_AddressBookService.Method.createNode.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createNode( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_AddressBookService.Method.deleteNode.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteNode( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_AddressBookService.Method.updateNode.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateNode( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_AddressBookServiceAsyncClientProtocol { - public func createNode( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.createNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateNodeInterceptors() ?? [] - ) - } - - public func deleteNode( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.deleteNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteNodeInterceptors() ?? [] - ) - } - - public func updateNode( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_AddressBookServiceClientMetadata.Methods.updateNode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateNodeInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_AddressBookService.ServiceProtocol { + public func createNode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createNode( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_AddressBookServiceAsyncClient: Proto_AddressBookServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_AddressBookServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func deleteNode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteNode( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_AddressBookServiceClientInterceptorFactoryProtocol: Sendable { + public func updateNode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateNode( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'createNode'. - func makecreateNodeInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_AddressBookService.SimpleServiceProtocol { + public func createNode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createNode( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'deleteNode'. - func makedeleteNodeInterceptors() -> [ClientInterceptor] + public func deleteNode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteNode( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'updateNode'. - func makeupdateNodeInterceptors() -> [ClientInterceptor] + public func updateNode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateNode( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -public enum Proto_AddressBookServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "AddressBookService", - fullName: "proto.AddressBookService", - methods: [ - Proto_AddressBookServiceClientMetadata.Methods.createNode, - Proto_AddressBookServiceClientMetadata.Methods.deleteNode, - Proto_AddressBookServiceClientMetadata.Methods.updateNode, - ] - ) - - public enum Methods { - public static let createNode = GRPCMethodDescriptor( - name: "createNode", - path: "/proto.AddressBookService/createNode", - type: GRPCCallType.unary - ) - - public static let deleteNode = GRPCMethodDescriptor( - name: "deleteNode", - path: "/proto.AddressBookService/deleteNode", - type: GRPCCallType.unary - ) - - public static let updateNode = GRPCMethodDescriptor( - name: "updateNode", - path: "/proto.AddressBookService/updateNode", - type: GRPCCallType.unary - ) - } -} +// MARK: proto.AddressBookService (client) + +extension Proto_AddressBookService { + /// Generated client protocol for the "proto.AddressBookService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Address Book service provides the ability for Hedera network node + /// > administrators to add, update, and remove consensus nodes. This addition, + /// > update, or removal of a consensus node requires governing council approval, + /// > but each node operator may update their own operational attributes without + /// > additional approval, reducing overhead for routine operations. + /// > + /// > Most operations are `privileged operations` and require governing council + /// > approval. + /// > + /// > ### For a node creation transaction. + /// > - The node operator SHALL create a `createNode` transaction. + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the new `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node creation transaction the network + /// > software SHALL + /// > - Validate the threshold signature for the Hedera governing council + /// > - Validate the signature of the `Key` provided as the new `admin_key` + /// > for the `Node`. + /// > - Create the new node in state, this new node SHALL NOT be active in the + /// > network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and bring the + /// > new node to an active status within the network. The node to be added + /// > SHALL be active in the network following this upgrade. + /// > + /// > ### For a node deletion transaction. + /// > - The node operator or Hedera council representative SHALL create a + /// > `deleteNode` transaction. + /// > - If the node operator creates the transaction + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the existing `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node deletion transaction the network + /// > software SHALL + /// > - Validate the signature for the Hedera governing council + /// > - Remove the existing node from network state. The node SHALL still + /// > be active in the network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and remove the + /// > node to be deleted from the network. The node to be deleted SHALL NOT + /// > be active in the network following this upgrade. + /// > + /// > ### For a node update transaction. + /// > - The node operator SHALL create an `updateNode` transaction. + /// > - The node operator MUST sign this transaction with the active `key` + /// > assigned as the `admin_key`. + /// > - The node operator SHALL submit the transaction to the + /// > network. Hedera council approval SHALL NOT be sought for this + /// > transaction + /// > - Upon receipt of a valid and signed node update transaction the network + /// > software SHALL + /// > - If the transaction modifies the value of the "node account", + /// > - Validate the signature of the active `key` for the account + /// > assigned as the _current_ "node account". + /// > - Validate the signature of the active `key` for the account to be + /// > assigned as the _new_ "node account". + /// > - Modify the node information held in network state with the changes + /// > requested in the update transaction. The node changes SHALL NOT be + /// > applied to network configuration, and SHALL NOT affect network + /// > operation at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration according to the + /// > modified information in network state. The requested changes SHALL + /// > affect network operation following this upgrade. + public protocol ClientProtocol: Sendable { + /// Call the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createNode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteNode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateNode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } -///* -/// The Address Book service provides the ability for Hedera network node -/// administrators to add, update, and remove consensus nodes. This addition, -/// update, or removal of a consensus node requires governing council approval, -/// but each node operator may update their own operational attributes without -/// additional approval, reducing overhead for routine operations. -/// -/// Most operations are `privileged operations` and require governing council -/// approval. -/// -/// ### For a node creation transaction. -/// - The node operator SHALL create a `createNode` transaction. -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the new `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node creation transaction the network -/// software SHALL -/// - Validate the threshold signature for the Hedera governing council -/// - Validate the signature of the `Key` provided as the new `admin_key` -/// for the `Node`. -/// - Create the new node in state, this new node SHALL NOT be active in the -/// network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and bring the -/// new node to an active status within the network. The node to be added -/// SHALL be active in the network following this upgrade. -/// -/// ### For a node deletion transaction. -/// - The node operator or Hedera council representative SHALL create a -/// `deleteNode` transaction. -/// - If the node operator creates the transaction -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the existing `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node deletion transaction the network -/// software SHALL -/// - Validate the signature for the Hedera governing council -/// - Remove the existing node from network state. The node SHALL still -/// be active in the network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and remove the -/// node to be deleted from the network. The node to be deleted SHALL NOT -/// be active in the network following this upgrade. -/// -/// ### For a node update transaction. -/// - The node operator SHALL create an `updateNode` transaction. -/// - The node operator MUST sign this transaction with the active `key` -/// assigned as the `admin_key`. -/// - The node operator SHALL submit the transaction to the -/// network. Hedera council approval SHALL NOT be sought for this -/// transaction -/// - Upon receipt of a valid and signed node update transaction the network -/// software SHALL -/// - If the transaction modifies the value of the "node account", -/// - Validate the signature of the active `key` for the account -/// assigned as the _current_ "node account". -/// - Validate the signature of the active `key` for the account to be -/// assigned as the _new_ "node account". -/// - Modify the node information held in network state with the changes -/// requested in the update transaction. The node changes SHALL NOT be -/// applied to network configuration, and SHALL NOT affect network -/// operation at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration according to the -/// modified information in network state. The requested changes SHALL -/// affect network operation following this upgrade. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_AddressBookServiceProvider: CallHandlerProvider { - var interceptors: Proto_AddressBookServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// A transaction to create a new consensus node in the network - /// address book. - ///

- /// This transaction, once complete, SHALL add a new consensus node to the - /// network state.
- /// The new consensus node SHALL remain in state, but SHALL NOT participate - /// in network consensus until the network updates the network configuration. - ///

- /// Hedera governing council authorization is REQUIRED for this transaction. - func createNode(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// A transaction to remove a consensus node from the network address - /// book. - ///

- /// This transaction, once complete, SHALL remove the identified consensus - /// node from the network state. - ///

- /// Hedera governing council authorization is REQUIRED for this transaction. - func deleteNode(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// A transaction to update an existing consensus node from the network - /// address book. - ///

- /// This transaction, once complete, SHALL modify the identified consensus - /// node state as requested. - ///

- /// This transaction is authorized by the node operator - func updateNode(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture + /// Generated client for the "proto.AddressBookService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Address Book service provides the ability for Hedera network node + /// > administrators to add, update, and remove consensus nodes. This addition, + /// > update, or removal of a consensus node requires governing council approval, + /// > but each node operator may update their own operational attributes without + /// > additional approval, reducing overhead for routine operations. + /// > + /// > Most operations are `privileged operations` and require governing council + /// > approval. + /// > + /// > ### For a node creation transaction. + /// > - The node operator SHALL create a `createNode` transaction. + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the new `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node creation transaction the network + /// > software SHALL + /// > - Validate the threshold signature for the Hedera governing council + /// > - Validate the signature of the `Key` provided as the new `admin_key` + /// > for the `Node`. + /// > - Create the new node in state, this new node SHALL NOT be active in the + /// > network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and bring the + /// > new node to an active status within the network. The node to be added + /// > SHALL be active in the network following this upgrade. + /// > + /// > ### For a node deletion transaction. + /// > - The node operator or Hedera council representative SHALL create a + /// > `deleteNode` transaction. + /// > - If the node operator creates the transaction + /// > - The node operator MUST sign this transaction with the `Key` + /// > set as the `admin_key` for the existing `Node`. + /// > - The node operator SHALL deliver the signed transaction to the Hedera + /// > council representative. + /// > - The Hedera council representative SHALL arrange for council members to + /// > review and sign the transaction. + /// > - Once sufficient council members have signed the transaction, the + /// > Hedera council representative SHALL submit the transaction to the + /// > network. + /// > - Upon receipt of a valid and signed node deletion transaction the network + /// > software SHALL + /// > - Validate the signature for the Hedera governing council + /// > - Remove the existing node from network state. The node SHALL still + /// > be active in the network at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration and remove the + /// > node to be deleted from the network. The node to be deleted SHALL NOT + /// > be active in the network following this upgrade. + /// > + /// > ### For a node update transaction. + /// > - The node operator SHALL create an `updateNode` transaction. + /// > - The node operator MUST sign this transaction with the active `key` + /// > assigned as the `admin_key`. + /// > - The node operator SHALL submit the transaction to the + /// > network. Hedera council approval SHALL NOT be sought for this + /// > transaction + /// > - Upon receipt of a valid and signed node update transaction the network + /// > software SHALL + /// > - If the transaction modifies the value of the "node account", + /// > - Validate the signature of the active `key` for the account + /// > assigned as the _current_ "node account". + /// > - Validate the signature of the active `key` for the account to be + /// > assigned as the _new_ "node account". + /// > - Modify the node information held in network state with the changes + /// > requested in the update transaction. The node changes SHALL NOT be + /// > applied to network configuration, and SHALL NOT affect network + /// > operation at this time. + /// > - When executing the next `freeze` transaction with `freeze_type` set to + /// > `PREPARE_UPGRADE`, update network configuration according to the + /// > modified information in network state. The requested changes SHALL + /// > affect network operation following this upgrade. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createNode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_AddressBookService.Method.createNode.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteNode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_AddressBookService.Method.deleteNode.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateNode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_AddressBookService.Method.updateNode.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + } } -extension Proto_AddressBookServiceProvider { - public var serviceName: Substring { - return Proto_AddressBookServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createNode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateNodeInterceptors() ?? [], - userFunction: self.createNode(request:context:) - ) - - case "deleteNode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteNodeInterceptors() ?? [], - userFunction: self.deleteNode(request:context:) - ) - - case "updateNode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateNodeInterceptors() ?? [], - userFunction: self.updateNode(request:context:) - ) - - default: - return nil +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_AddressBookService.ClientProtocol { + /// Call the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createNode( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createNode( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) } - } -} -///* -/// The Address Book service provides the ability for Hedera network node -/// administrators to add, update, and remove consensus nodes. This addition, -/// update, or removal of a consensus node requires governing council approval, -/// but each node operator may update their own operational attributes without -/// additional approval, reducing overhead for routine operations. -/// -/// Most operations are `privileged operations` and require governing council -/// approval. -/// -/// ### For a node creation transaction. -/// - The node operator SHALL create a `createNode` transaction. -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the new `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node creation transaction the network -/// software SHALL -/// - Validate the threshold signature for the Hedera governing council -/// - Validate the signature of the `Key` provided as the new `admin_key` -/// for the `Node`. -/// - Create the new node in state, this new node SHALL NOT be active in the -/// network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and bring the -/// new node to an active status within the network. The node to be added -/// SHALL be active in the network following this upgrade. -/// -/// ### For a node deletion transaction. -/// - The node operator or Hedera council representative SHALL create a -/// `deleteNode` transaction. -/// - If the node operator creates the transaction -/// - The node operator MUST sign this transaction with the `Key` -/// set as the `admin_key` for the existing `Node`. -/// - The node operator SHALL deliver the signed transaction to the Hedera -/// council representative. -/// - The Hedera council representative SHALL arrange for council members to -/// review and sign the transaction. -/// - Once sufficient council members have signed the transaction, the -/// Hedera council representative SHALL submit the transaction to the -/// network. -/// - Upon receipt of a valid and signed node deletion transaction the network -/// software SHALL -/// - Validate the signature for the Hedera governing council -/// - Remove the existing node from network state. The node SHALL still -/// be active in the network at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration and remove the -/// node to be deleted from the network. The node to be deleted SHALL NOT -/// be active in the network following this upgrade. -/// -/// ### For a node update transaction. -/// - The node operator SHALL create an `updateNode` transaction. -/// - The node operator MUST sign this transaction with the active `key` -/// assigned as the `admin_key`. -/// - The node operator SHALL submit the transaction to the -/// network. Hedera council approval SHALL NOT be sought for this -/// transaction -/// - Upon receipt of a valid and signed node update transaction the network -/// software SHALL -/// - If the transaction modifies the value of the "node account", -/// - Validate the signature of the active `key` for the account -/// assigned as the _current_ "node account". -/// - Validate the signature of the active `key` for the account to be -/// assigned as the _new_ "node account". -/// - Modify the node information held in network state with the changes -/// requested in the update transaction. The node changes SHALL NOT be -/// applied to network configuration, and SHALL NOT affect network -/// operation at this time. -/// - When executing the next `freeze` transaction with `freeze_type` set to -/// `PREPARE_UPGRADE`, update network configuration according to the -/// modified information in network state. The requested changes SHALL -/// affect network operation following this upgrade. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_AddressBookServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_AddressBookServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// A transaction to create a new consensus node in the network - /// address book. - ///

- /// This transaction, once complete, SHALL add a new consensus node to the - /// network state.
- /// The new consensus node SHALL remain in state, but SHALL NOT participate - /// in network consensus until the network updates the network configuration. - ///

- /// Hedera governing council authorization is REQUIRED for this transaction. - func createNode( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// A transaction to remove a consensus node from the network address - /// book. - ///

- /// This transaction, once complete, SHALL remove the identified consensus - /// node from the network state. - ///

- /// Hedera governing council authorization is REQUIRED for this transaction. - func deleteNode( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// A transaction to update an existing consensus node from the network - /// address book. - ///

- /// This transaction, once complete, SHALL modify the identified consensus - /// node state as requested. - ///

- /// This transaction is authorized by the node operator - func updateNode( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse -} + /// Call the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteNode( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteNode( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_AddressBookServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_AddressBookServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_AddressBookServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_AddressBookServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createNode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateNodeInterceptors() ?? [], - wrapping: { try await self.createNode(request: $0, context: $1) } - ) - - case "deleteNode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteNodeInterceptors() ?? [], - wrapping: { try await self.deleteNode(request: $0, context: $1) } - ) - - case "updateNode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateNodeInterceptors() ?? [], - wrapping: { try await self.updateNode(request: $0, context: $1) } - ) - - default: - return nil + /// Call the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateNode( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateNode( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) } - } } -public protocol Proto_AddressBookServiceServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'createNode'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateNodeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'deleteNode'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteNodeInterceptors() -> [ServerInterceptor] +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_AddressBookService.ClientProtocol { + /// Call the "createNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to create a new consensus node in the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL add a new consensus node to the + /// > network state.
+ /// > The new consensus node SHALL remain in state, but SHALL NOT participate + /// > in network consensus until the network updates the network configuration. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createNode( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createNode( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'updateNode'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateNodeInterceptors() -> [ServerInterceptor] -} + /// Call the "deleteNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to remove a consensus node from the network address + /// > book. + /// >

+ /// > This transaction, once complete, SHALL remove the identified consensus + /// > node from the network state. + /// >

+ /// > Hedera governing council authorization is REQUIRED for this transaction. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteNode( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteNode( + request: request, + options: options, + onResponse: handleResponse + ) + } -public enum Proto_AddressBookServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "AddressBookService", - fullName: "proto.AddressBookService", - methods: [ - Proto_AddressBookServiceServerMetadata.Methods.createNode, - Proto_AddressBookServiceServerMetadata.Methods.deleteNode, - Proto_AddressBookServiceServerMetadata.Methods.updateNode, - ] - ) - - public enum Methods { - public static let createNode = GRPCMethodDescriptor( - name: "createNode", - path: "/proto.AddressBookService/createNode", - type: GRPCCallType.unary - ) - - public static let deleteNode = GRPCMethodDescriptor( - name: "deleteNode", - path: "/proto.AddressBookService/deleteNode", - type: GRPCCallType.unary - ) - - public static let updateNode = GRPCMethodDescriptor( - name: "updateNode", - path: "/proto.AddressBookService/updateNode", - type: GRPCCallType.unary - ) - } -} + /// Call the "updateNode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A transaction to update an existing consensus node from the network + /// > address book. + /// >

+ /// > This transaction, once complete, SHALL modify the identified consensus + /// > node state as requested. + /// >

+ /// > This transaction is authorized by the node operator + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateNode( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateNode( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/hints/crs_publication.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/crs_publication.grpc.swift new file mode 100644 index 00000000..e87330a4 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/crs_publication.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # hinTS Key Publication Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/hints/crs_publication.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_key_publication.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_key_publication.grpc.swift new file mode 100644 index 00000000..62f8e092 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_key_publication.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # hinTS Key Publication Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/hints/hints_key_publication.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_partial_signature.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_partial_signature.grpc.swift new file mode 100644 index 00000000..ff2a957e --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_partial_signature.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # hinTS Partial Signature Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/hints/hints_partial_signature.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_preprocessing_vote.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_preprocessing_vote.grpc.swift new file mode 100644 index 00000000..5ae198f9 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/hints/hints_preprocessing_vote.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # hinTS Aggregation Vote Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/hints/hints_preprocessing_vote.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_key_publication.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_key_publication.grpc.swift new file mode 100644 index 00000000..f5e765e8 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_key_publication.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # Proof Key Publication Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/history/history_proof_key_publication.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_signature.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_signature.grpc.swift new file mode 100644 index 00000000..996bce69 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_signature.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # Metadata Proof Assembly Signature Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/history/history_proof_signature.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_vote.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_vote.grpc.swift new file mode 100644 index 00000000..e3904a7a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/history/history_proof_vote.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # Metadata Proof Vote Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/history/history_proof_vote.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/tss/tss_message.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/tss/tss_message.grpc.swift new file mode 100644 index 00000000..f816a7c2 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/tss/tss_message.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # Tss Message Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/tss/tss_message.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/auxiliary/tss/tss_vote.grpc.swift b/Sources/HieroProtobufs/Generated/services/auxiliary/tss/tss_vote.grpc.swift new file mode 100644 index 00000000..402c424a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/auxiliary/tss/tss_vote.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # Tss Vote Transaction +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/auxiliary/tss/tss_vote.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/basic_types.grpc.swift b/Sources/HieroProtobufs/Generated/services/basic_types.grpc.swift new file mode 100644 index 00000000..d98d54b5 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/basic_types.grpc.swift @@ -0,0 +1,45 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/basic_types.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_create_topic.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_create_topic.grpc.swift new file mode 100644 index 00000000..5c726c72 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/consensus_create_topic.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Create Topic +/// Create a new topic for the Hedera Consensus Service (HCS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/consensus_create_topic.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_delete_topic.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_delete_topic.grpc.swift new file mode 100644 index 00000000..7b117b7f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/consensus_delete_topic.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Delete Topic +/// Delete an existing topic from the Hedera Consensus Service (HCS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/consensus_delete_topic.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_get_topic_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_get_topic_info.grpc.swift new file mode 100644 index 00000000..5148b733 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/consensus_get_topic_info.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Topic +/// Query a topic in the Hedera Consensus Service (HCS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/consensus_get_topic_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_service.grpc.swift index 21a32372..54e97232 100644 --- a/Sources/HieroProtobufs/Generated/services/consensus_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/consensus_service.grpc.swift @@ -1,900 +1,1678 @@ -// +///* +/// # Consensus Service API +/// GRPC service definitions for the Hedera Consensus Service (HCS). +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/consensus_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to -/// provide aBFT consensus as to the order and validity of messages submitted to -/// a *topic*, as well as a *consensus timestamp* for those messages. -/// -/// Usage: instantiate `Proto_ConsensusServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_ConsensusServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? { get } - - func createTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func submitMessage( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func getTopicInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.ConsensusService + +/// Namespace containing generated types for the "proto.ConsensusService" service. +public enum Proto_ConsensusService { + /// Service descriptor for the "proto.ConsensusService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createTopic" metadata. + public enum createTopic { + /// Request type for "createTopic". + public typealias Input = Proto_Transaction + /// Response type for "createTopic". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createTopic". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService"), + method: "createTopic" + ) + } + /// Namespace for "updateTopic" metadata. + public enum updateTopic { + /// Request type for "updateTopic". + public typealias Input = Proto_Transaction + /// Response type for "updateTopic". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateTopic". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService"), + method: "updateTopic" + ) + } + /// Namespace for "deleteTopic" metadata. + public enum deleteTopic { + /// Request type for "deleteTopic". + public typealias Input = Proto_Transaction + /// Response type for "deleteTopic". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteTopic". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService"), + method: "deleteTopic" + ) + } + /// Namespace for "submitMessage" metadata. + public enum submitMessage { + /// Request type for "submitMessage". + public typealias Input = Proto_Transaction + /// Response type for "submitMessage". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "submitMessage". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService"), + method: "submitMessage" + ) + } + /// Namespace for "getTopicInfo" metadata. + public enum getTopicInfo { + /// Request type for "getTopicInfo". + public typealias Input = Proto_Query + /// Response type for "getTopicInfo". + public typealias Output = Proto_Response + /// Descriptor for "getTopicInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService"), + method: "getTopicInfo" + ) + } + /// Descriptors for all methods in the "proto.ConsensusService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createTopic.descriptor, + updateTopic.descriptor, + deleteTopic.descriptor, + submitMessage.descriptor, + getTopicInfo.descriptor + ] + } } -extension Proto_ConsensusServiceClientProtocol { - public var serviceName: String { - return "proto.ConsensusService" - } - - ///* - /// Create an HCS topic. - ///

- /// On success, the resulting TransactionReceipt SHALL contain the newly - /// created TopicId.
- /// If the `adminKey` is set on the topic, this transaction MUST be signed - /// by that key.
- /// If the `adminKey` is _not_ set on the topic, this transaction MUST NOT - /// set an `autoRenewAccount`. The new topic will be immutable and must be - /// renewed manually.
- /// If the `autoRenewAccount` is set on the topic, this transaction MUST be - /// signed by that account.
- ///

- /// The request body MUST be a - /// [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) - /// - /// - Parameters: - /// - request: Request to send to createTopic. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.createTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateTopicInterceptors() ?? [] - ) - } - - ///* - /// Update an HCS topic. - ///

- /// If the `adminKey` is not set on the topic, this transaction MUST extend - /// the `expirationTime` and MUST NOT modify any other field.
- /// If the `adminKey` is set on the topic, this transaction MUST be signed - /// by that key.
- /// If this transaction sets a new `adminKey`, this transaction MUST be - /// signed by _both_ keys, the pre-update `adminKey` and - /// the post-update `adminKey`.
- /// If this transaction sets a new, non-null, `autoRenewAccount`, the newly - /// set account MUST sign this transaction.
- ///

- /// The request body MUST be a - /// [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) - /// - /// - Parameters: - /// - request: Request to send to updateTopic. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.updateTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTopicInterceptors() ?? [] - ) - } - - ///* - /// Delete an HCS topic. - ///

- /// If this transaction succeeds, all subsequent transactions referencing - /// the deleted topic SHALL fail.
- /// The `adminKey` MUST be set on the topic and this transaction MUST be - /// signed by that key.
- /// If the `adminKey` is not set on the topic, this transaction SHALL fail - /// with a response code of `UNAUTHORIZED`. A topic without an `adminKey` - /// cannot be deleted, but MAY expire.
- ///

- /// The request body MUST be a - /// [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) - /// - /// - Parameters: - /// - request: Request to send to deleteTopic. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.deleteTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteTopicInterceptors() ?? [] - ) - } - - ///* - /// Submit a message to an HCS topic. - ///

- /// Valid and authorized messages on valid topics will be ordered by the - /// consensus service, published in the block stream, and available to all - /// subscribers on this topic via the mirror nodes.
- /// If this transaction succeeds the resulting TransactionReceipt SHALL - /// contain the latest topicSequenceNumber and topicRunningHash for the - /// topic.
- /// If the topic has a `submitKey` then that key MUST sign this - /// transaction.
- ///

- /// The request body MUST be a - /// [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) - /// - /// - Parameters: - /// - request: Request to send to submitMessage. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func submitMessage( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.submitMessage.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesubmitMessageInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the latest state of a topic. This method is unrestricted and - /// allowed on any topic by any payer account. - ///

- /// The request body MUST be a - /// [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
- /// The response body SHALL be a - /// [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) - /// - /// - Parameters: - /// - request: Request to send to getTopicInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTopicInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.getTopicInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTopicInfoInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.ConsensusService" service. + public static let proto_ConsensusService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ConsensusService") } -@available(*, deprecated) -extension Proto_ConsensusServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_ConsensusServiceNIOClient") -public final class Proto_ConsensusServiceClient: Proto_ConsensusServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.ConsensusService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.ConsensusService (server) + +extension Proto_ConsensusService { + /// Streaming variant of the service protocol for the "proto.ConsensusService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to + /// > provide aBFT consensus as to the order and validity of messages submitted to + /// > a *topic*, as well as a *consensus timestamp* for those messages. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createTopic( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateTopic( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteTopic( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func submitMessage( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getTopicInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_ConsensusServiceNIOClient: Proto_ConsensusServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.ConsensusService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.ConsensusService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to + /// > provide aBFT consensus as to the order and validity of messages submitted to + /// > a *topic*, as well as a *consensus timestamp* for those messages. + public protocol ServiceProtocol: Proto_ConsensusService.StreamingServiceProtocol { + /// Handle the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createTopic( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateTopic( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteTopic( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func submitMessage( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getTopicInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to -/// provide aBFT consensus as to the order and validity of messages submitted to -/// a *topic*, as well as a *consensus timestamp* for those messages. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_ConsensusServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateTopicCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateTopicCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteTopicCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSubmitMessageCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetTopicInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.ConsensusService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to + /// > provide aBFT consensus as to the order and validity of messages submitted to + /// > a *topic*, as well as a *consensus timestamp* for those messages. + public protocol SimpleServiceProtocol: Proto_ConsensusService.ServiceProtocol { + /// Handle the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createTopic( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateTopic( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteTopic( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func submitMessage( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getTopicInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_ConsensusServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_ConsensusServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateTopicCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.createTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateTopicInterceptors() ?? [] - ) - } - - public func makeUpdateTopicCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.updateTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTopicInterceptors() ?? [] - ) - } - - public func makeDeleteTopicCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.deleteTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteTopicInterceptors() ?? [] - ) - } - - public func makeSubmitMessageCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.submitMessage.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesubmitMessageInterceptors() ?? [] - ) - } - - public func makeGetTopicInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.getTopicInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTopicInfoInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_ConsensusService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_ConsensusService.Method.createTopic.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createTopic( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ConsensusService.Method.updateTopic.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateTopic( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ConsensusService.Method.deleteTopic.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteTopic( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ConsensusService.Method.submitMessage.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.submitMessage( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ConsensusService.Method.getTopicInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getTopicInfo( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_ConsensusServiceAsyncClientProtocol { - public func createTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.createTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateTopicInterceptors() ?? [] - ) - } - - public func updateTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.updateTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTopicInterceptors() ?? [] - ) - } - - public func deleteTopic( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.deleteTopic.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteTopicInterceptors() ?? [] - ) - } - - public func submitMessage( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.submitMessage.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesubmitMessageInterceptors() ?? [] - ) - } - - public func getTopicInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_ConsensusServiceClientMetadata.Methods.getTopicInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTopicInfoInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_ConsensusService.ServiceProtocol { + public func createTopic( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createTopic( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_ConsensusServiceAsyncClient: Proto_ConsensusServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_ConsensusServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func updateTopic( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateTopic( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_ConsensusServiceClientInterceptorFactoryProtocol: Sendable { + public func deleteTopic( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteTopic( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func submitMessage( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.submitMessage( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func getTopicInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getTopicInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'createTopic'. - func makecreateTopicInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_ConsensusService.SimpleServiceProtocol { + public func createTopic( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createTopic( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'updateTopic'. - func makeupdateTopicInterceptors() -> [ClientInterceptor] + public func updateTopic( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateTopic( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'deleteTopic'. - func makedeleteTopicInterceptors() -> [ClientInterceptor] + public func deleteTopic( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteTopic( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'submitMessage'. - func makesubmitMessageInterceptors() -> [ClientInterceptor] + public func submitMessage( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.submitMessage( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getTopicInfo'. - func makegetTopicInfoInterceptors() -> [ClientInterceptor] + public func getTopicInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getTopicInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -public enum Proto_ConsensusServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "ConsensusService", - fullName: "proto.ConsensusService", - methods: [ - Proto_ConsensusServiceClientMetadata.Methods.createTopic, - Proto_ConsensusServiceClientMetadata.Methods.updateTopic, - Proto_ConsensusServiceClientMetadata.Methods.deleteTopic, - Proto_ConsensusServiceClientMetadata.Methods.submitMessage, - Proto_ConsensusServiceClientMetadata.Methods.getTopicInfo, - ] - ) - - public enum Methods { - public static let createTopic = GRPCMethodDescriptor( - name: "createTopic", - path: "/proto.ConsensusService/createTopic", - type: GRPCCallType.unary - ) - - public static let updateTopic = GRPCMethodDescriptor( - name: "updateTopic", - path: "/proto.ConsensusService/updateTopic", - type: GRPCCallType.unary - ) - - public static let deleteTopic = GRPCMethodDescriptor( - name: "deleteTopic", - path: "/proto.ConsensusService/deleteTopic", - type: GRPCCallType.unary - ) - - public static let submitMessage = GRPCMethodDescriptor( - name: "submitMessage", - path: "/proto.ConsensusService/submitMessage", - type: GRPCCallType.unary - ) - - public static let getTopicInfo = GRPCMethodDescriptor( - name: "getTopicInfo", - path: "/proto.ConsensusService/getTopicInfo", - type: GRPCCallType.unary - ) - } -} +// MARK: proto.ConsensusService (client) + +extension Proto_ConsensusService { + /// Generated client protocol for the "proto.ConsensusService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to + /// > provide aBFT consensus as to the order and validity of messages submitted to + /// > a *topic*, as well as a *consensus timestamp* for those messages. + public protocol ClientProtocol: Sendable { + /// Call the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createTopic( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateTopic( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteTopic( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func submitMessage( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getTopicInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } -///* -/// The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to -/// provide aBFT consensus as to the order and validity of messages submitted to -/// a *topic*, as well as a *consensus timestamp* for those messages. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_ConsensusServiceProvider: CallHandlerProvider { - var interceptors: Proto_ConsensusServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create an HCS topic. - ///

- /// On success, the resulting TransactionReceipt SHALL contain the newly - /// created TopicId.
- /// If the `adminKey` is set on the topic, this transaction MUST be signed - /// by that key.
- /// If the `adminKey` is _not_ set on the topic, this transaction MUST NOT - /// set an `autoRenewAccount`. The new topic will be immutable and must be - /// renewed manually.
- /// If the `autoRenewAccount` is set on the topic, this transaction MUST be - /// signed by that account.
- ///

- /// The request body MUST be a - /// [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) - func createTopic(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Update an HCS topic. - ///

- /// If the `adminKey` is not set on the topic, this transaction MUST extend - /// the `expirationTime` and MUST NOT modify any other field.
- /// If the `adminKey` is set on the topic, this transaction MUST be signed - /// by that key.
- /// If this transaction sets a new `adminKey`, this transaction MUST be - /// signed by _both_ keys, the pre-update `adminKey` and - /// the post-update `adminKey`.
- /// If this transaction sets a new, non-null, `autoRenewAccount`, the newly - /// set account MUST sign this transaction.
- ///

- /// The request body MUST be a - /// [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) - func updateTopic(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete an HCS topic. - ///

- /// If this transaction succeeds, all subsequent transactions referencing - /// the deleted topic SHALL fail.
- /// The `adminKey` MUST be set on the topic and this transaction MUST be - /// signed by that key.
- /// If the `adminKey` is not set on the topic, this transaction SHALL fail - /// with a response code of `UNAUTHORIZED`. A topic without an `adminKey` - /// cannot be deleted, but MAY expire.
- ///

- /// The request body MUST be a - /// [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) - func deleteTopic(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Submit a message to an HCS topic. - ///

- /// Valid and authorized messages on valid topics will be ordered by the - /// consensus service, published in the block stream, and available to all - /// subscribers on this topic via the mirror nodes.
- /// If this transaction succeeds the resulting TransactionReceipt SHALL - /// contain the latest topicSequenceNumber and topicRunningHash for the - /// topic.
- /// If the topic has a `submitKey` then that key MUST sign this - /// transaction.
- ///

- /// The request body MUST be a - /// [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) - func submitMessage(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the latest state of a topic. This method is unrestricted and - /// allowed on any topic by any payer account. - ///

- /// The request body MUST be a - /// [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
- /// The response body SHALL be a - /// [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) - func getTopicInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture + /// Generated client for the "proto.ConsensusService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to + /// > provide aBFT consensus as to the order and validity of messages submitted to + /// > a *topic*, as well as a *consensus timestamp* for those messages. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createTopic( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ConsensusService.Method.createTopic.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateTopic( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ConsensusService.Method.updateTopic.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteTopic( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ConsensusService.Method.deleteTopic.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func submitMessage( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ConsensusService.Method.submitMessage.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTopicInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ConsensusService.Method.getTopicInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + } } -extension Proto_ConsensusServiceProvider { - public var serviceName: Substring { - return Proto_ConsensusServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createTopic": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateTopicInterceptors() ?? [], - userFunction: self.createTopic(request:context:) - ) - - case "updateTopic": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateTopicInterceptors() ?? [], - userFunction: self.updateTopic(request:context:) - ) - - case "deleteTopic": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteTopicInterceptors() ?? [], - userFunction: self.deleteTopic(request:context:) - ) - - case "submitMessage": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesubmitMessageInterceptors() ?? [], - userFunction: self.submitMessage(request:context:) - ) - - case "getTopicInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTopicInfoInterceptors() ?? [], - userFunction: self.getTopicInfo(request:context:) - ) - - default: - return nil +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_ConsensusService.ClientProtocol { + /// Call the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createTopic( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createTopic( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) } - } -} -///* -/// The Hedera Consensus Service (HCS) provides the ability for a Hashgraph to -/// provide aBFT consensus as to the order and validity of messages submitted to -/// a *topic*, as well as a *consensus timestamp* for those messages. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_ConsensusServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_ConsensusServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create an HCS topic. - ///

- /// On success, the resulting TransactionReceipt SHALL contain the newly - /// created TopicId.
- /// If the `adminKey` is set on the topic, this transaction MUST be signed - /// by that key.
- /// If the `adminKey` is _not_ set on the topic, this transaction MUST NOT - /// set an `autoRenewAccount`. The new topic will be immutable and must be - /// renewed manually.
- /// If the `autoRenewAccount` is set on the topic, this transaction MUST be - /// signed by that account.
- ///

- /// The request body MUST be a - /// [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) - func createTopic( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Update an HCS topic. - ///

- /// If the `adminKey` is not set on the topic, this transaction MUST extend - /// the `expirationTime` and MUST NOT modify any other field.
- /// If the `adminKey` is set on the topic, this transaction MUST be signed - /// by that key.
- /// If this transaction sets a new `adminKey`, this transaction MUST be - /// signed by _both_ keys, the pre-update `adminKey` and - /// the post-update `adminKey`.
- /// If this transaction sets a new, non-null, `autoRenewAccount`, the newly - /// set account MUST sign this transaction.
- ///

- /// The request body MUST be a - /// [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) - func updateTopic( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete an HCS topic. - ///

- /// If this transaction succeeds, all subsequent transactions referencing - /// the deleted topic SHALL fail.
- /// The `adminKey` MUST be set on the topic and this transaction MUST be - /// signed by that key.
- /// If the `adminKey` is not set on the topic, this transaction SHALL fail - /// with a response code of `UNAUTHORIZED`. A topic without an `adminKey` - /// cannot be deleted, but MAY expire.
- ///

- /// The request body MUST be a - /// [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) - func deleteTopic( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Submit a message to an HCS topic. - ///

- /// Valid and authorized messages on valid topics will be ordered by the - /// consensus service, published in the block stream, and available to all - /// subscribers on this topic via the mirror nodes.
- /// If this transaction succeeds the resulting TransactionReceipt SHALL - /// contain the latest topicSequenceNumber and topicRunningHash for the - /// topic.
- /// If the topic has a `submitKey` then that key MUST sign this - /// transaction.
- ///

- /// The request body MUST be a - /// [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) - func submitMessage( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Retrieve the latest state of a topic. This method is unrestricted and - /// allowed on any topic by any payer account. - ///

- /// The request body MUST be a - /// [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
- /// The response body SHALL be a - /// [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) - func getTopicInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response -} + /// Call the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateTopic( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateTopic( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_ConsensusServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_ConsensusServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_ConsensusServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_ConsensusServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createTopic": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateTopicInterceptors() ?? [], - wrapping: { try await self.createTopic(request: $0, context: $1) } - ) - - case "updateTopic": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateTopicInterceptors() ?? [], - wrapping: { try await self.updateTopic(request: $0, context: $1) } - ) - - case "deleteTopic": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteTopicInterceptors() ?? [], - wrapping: { try await self.deleteTopic(request: $0, context: $1) } - ) - - case "submitMessage": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesubmitMessageInterceptors() ?? [], - wrapping: { try await self.submitMessage(request: $0, context: $1) } - ) - - case "getTopicInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTopicInfoInterceptors() ?? [], - wrapping: { try await self.getTopicInfo(request: $0, context: $1) } - ) - - default: - return nil + /// Call the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteTopic( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteTopic( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) } - } -} -public protocol Proto_ConsensusServiceServerInterceptorFactoryProtocol: Sendable { + /// Call the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func submitMessage( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.submitMessage( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'createTopic'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateTopicInterceptors() -> [ServerInterceptor] + /// Call the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTopicInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getTopicInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } +} - /// - Returns: Interceptors to use when handling 'updateTopic'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateTopicInterceptors() -> [ServerInterceptor] +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_ConsensusService.ClientProtocol { + /// Call the "createTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create an HCS topic. + /// >

+ /// > On success, the resulting TransactionReceipt SHALL contain the newly + /// > created TopicId.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If the `adminKey` is _not_ set on the topic, this transaction MUST NOT + /// > set an `autoRenewAccount`. The new topic will be immutable and must be + /// > renewed manually.
+ /// > If the `autoRenewAccount` is set on the topic, this transaction MUST be + /// > signed by that account.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusCreateTopicTransactionBody](#proto.ConsensusCreateTopicTransactionBody) + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createTopic( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createTopic( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteTopic'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteTopicInterceptors() -> [ServerInterceptor] + /// Call the "updateTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an HCS topic. + /// >

+ /// > If the `adminKey` is not set on the topic, this transaction MUST extend + /// > the `expirationTime` and MUST NOT modify any other field.
+ /// > If the `adminKey` is set on the topic, this transaction MUST be signed + /// > by that key.
+ /// > If this transaction sets a new `adminKey`, this transaction MUST be + /// > signed by _both_ keys, the pre-update `adminKey` and + /// > the post-update `adminKey`.
+ /// > If this transaction sets a new, non-null, `autoRenewAccount`, the newly + /// > set account MUST sign this transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusUpdateTopicTransactionBody](#proto.ConsensusUpdateTopicTransactionBody) + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateTopic( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateTopic( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'submitMessage'. - /// Defaults to calling `self.makeInterceptors()`. - func makesubmitMessageInterceptors() -> [ServerInterceptor] + /// Call the "deleteTopic" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an HCS topic. + /// >

+ /// > If this transaction succeeds, all subsequent transactions referencing + /// > the deleted topic SHALL fail.
+ /// > The `adminKey` MUST be set on the topic and this transaction MUST be + /// > signed by that key.
+ /// > If the `adminKey` is not set on the topic, this transaction SHALL fail + /// > with a response code of `UNAUTHORIZED`. A topic without an `adminKey` + /// > cannot be deleted, but MAY expire.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteTopic( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteTopic( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getTopicInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetTopicInfoInterceptors() -> [ServerInterceptor] -} + /// Call the "submitMessage" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a message to an HCS topic. + /// >

+ /// > Valid and authorized messages on valid topics will be ordered by the + /// > consensus service, published in the block stream, and available to all + /// > subscribers on this topic via the mirror nodes.
+ /// > If this transaction succeeds the resulting TransactionReceipt SHALL + /// > contain the latest topicSequenceNumber and topicRunningHash for the + /// > topic.
+ /// > If the topic has a `submitKey` then that key MUST sign this + /// > transaction.
+ /// >

+ /// > The request body MUST be a + /// > [ConsensusSubmitMessageTransactionBody](#proto.ConsensusSubmitMessageTransactionBody) + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func submitMessage( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.submitMessage( + request: request, + options: options, + onResponse: handleResponse + ) + } -public enum Proto_ConsensusServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "ConsensusService", - fullName: "proto.ConsensusService", - methods: [ - Proto_ConsensusServiceServerMetadata.Methods.createTopic, - Proto_ConsensusServiceServerMetadata.Methods.updateTopic, - Proto_ConsensusServiceServerMetadata.Methods.deleteTopic, - Proto_ConsensusServiceServerMetadata.Methods.submitMessage, - Proto_ConsensusServiceServerMetadata.Methods.getTopicInfo, - ] - ) - - public enum Methods { - public static let createTopic = GRPCMethodDescriptor( - name: "createTopic", - path: "/proto.ConsensusService/createTopic", - type: GRPCCallType.unary - ) - - public static let updateTopic = GRPCMethodDescriptor( - name: "updateTopic", - path: "/proto.ConsensusService/updateTopic", - type: GRPCCallType.unary - ) - - public static let deleteTopic = GRPCMethodDescriptor( - name: "deleteTopic", - path: "/proto.ConsensusService/deleteTopic", - type: GRPCCallType.unary - ) - - public static let submitMessage = GRPCMethodDescriptor( - name: "submitMessage", - path: "/proto.ConsensusService/submitMessage", - type: GRPCCallType.unary - ) - - public static let getTopicInfo = GRPCMethodDescriptor( - name: "getTopicInfo", - path: "/proto.ConsensusService/getTopicInfo", - type: GRPCCallType.unary - ) - } -} + /// Call the "getTopicInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest state of a topic. This method is unrestricted and + /// > allowed on any topic by any payer account. + /// >

+ /// > The request body MUST be a + /// > [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery)
+ /// > The response body SHALL be a + /// > [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTopicInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getTopicInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_submit_message.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_submit_message.grpc.swift new file mode 100644 index 00000000..9b52921d --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/consensus_submit_message.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Submit Message +/// Submit a message to a topic via the Hedera Consensus Service (HCS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/consensus_submit_message.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_topic_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_topic_info.grpc.swift new file mode 100644 index 00000000..5f3f9aa2 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/consensus_topic_info.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Topic Information +/// Query response describing a topic of the Hedera Consensus Service (HCS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/consensus_topic_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/consensus_update_topic.grpc.swift b/Sources/HieroProtobufs/Generated/services/consensus_update_topic.grpc.swift new file mode 100644 index 00000000..2c4dbdce --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/consensus_update_topic.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Update Topic +/// Update a topic for the Hedera Consensus Service (HCS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/consensus_update_topic.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_call.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_call.grpc.swift new file mode 100644 index 00000000..6afa3d9f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_call.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Contract Call +/// Transaction body for calls to a Smart Contract. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_call.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_call_local.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_call_local.grpc.swift new file mode 100644 index 00000000..aa7e2bbb --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_call_local.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Local Contract Call +/// A Contract Call executed directly on the current node +/// (that is, without consensus). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_call_local.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_create.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_create.grpc.swift new file mode 100644 index 00000000..15a02e9f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_create.grpc.swift @@ -0,0 +1,46 @@ +///* +/// # Smart Contract Create +/// +/// Create a new smart contract. +/// +/// ## General Comments +/// - A smart contract normally enforces rules, so "the code is law".
+/// For example, an ERC-20 contract prevents a transfer from being undone +/// without a signature by the recipient of the transfer. This characteristic +/// is generally true if the contract instance was created without a value +/// for the `adminKey` field. For some uses, however, it may be desirable to +/// create something like an ERC-20 contract that has a specific group of +/// trusted individuals who can act as a "supreme court" with the ability to +/// override the normal operation, when a sufficient number of them agree to +/// do so. If `adminKey` is set to a valid Key (which MAY be complex), then a +/// transaction that can change the state of the smart contract in arbitrary +/// ways MAY be signed with enough signatures to activate that Key. Such +/// transactions might reverse a transaction, change the code to close an +/// unexpected loophole, remove an exploit, or adjust outputs in ways not +/// covered by the code itself. The admin key MAY also be used to change the +/// autoRenewPeriod, and change the adminKey field itself (for example, to +/// remove that key after a suitable testing period). The API currently does +/// not implement all relevant capabilities. But it does allow the `adminKey` +/// field to be set and queried, and MAY implement further administrative +/// capability in future releases. +/// - The current API ignores shardID, realmID, and newRealmAdminKey, and +/// creates everything in shard 0 and realm 0. Future versions of the system +/// MAY support additional shards and realms. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_create.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_delete.grpc.swift new file mode 100644 index 00000000..9b93f429 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_delete.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Contract Delete +/// Delete a smart contract, transferring any remaining balance to a +/// designated account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_get_bytecode.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_get_bytecode.grpc.swift new file mode 100644 index 00000000..f6fc41f3 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_get_bytecode.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Contract Bytecode +/// A standard query to read the current bytecode for a smart contract. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_get_bytecode.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_get_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_get_info.grpc.swift new file mode 100644 index 00000000..f4afc851 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_get_info.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Contract Get Info +/// A standard query to obtain detailed information about a smart contract. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_get_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_get_records.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_get_records.grpc.swift new file mode 100644 index 00000000..3bea9230 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_get_records.grpc.swift @@ -0,0 +1,25 @@ +///* +/// # Get contract records +/// Deprecated query messages to read all recent contract transaction records. +/// +/// > REVIEW QUESTION +/// >> Can we delete this file and remove the related query entirely? +/// >> It appears it hasn't been supported for over 3½ years... +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_get_records.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_types.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_types.grpc.swift new file mode 100644 index 00000000..d4e9cc74 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_types.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Contract Message Types +/// Message types used in contract transactions. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_types.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/contract_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/contract_update.grpc.swift new file mode 100644 index 00000000..49c5f036 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/contract_update.grpc.swift @@ -0,0 +1,23 @@ +///* +/// # Contract Update +/// Modify a smart contract. Any change other than updating the expiration time +/// requires that the contract be modifiable (has a valid `adminKey`) and that +/// the transaction be signed by the `adminKey` +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/contract_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_add_live_hash.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_add_live_hash.grpc.swift new file mode 100644 index 00000000..e4ebeb2f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_add_live_hash.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Add Live Hash +/// Associate content to an account via a SHA-384 hash. +/// +/// > Important +/// >> This transaction is obsolete and not supported.
+/// >> Any transaction of this type that is submitted SHALL fail +/// >> with a `PRE_CHECK` result of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_add_live_hash.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_approve_allowance.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_approve_allowance.grpc.swift new file mode 100644 index 00000000..6f98272f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_approve_allowance.grpc.swift @@ -0,0 +1,25 @@ +///* +/// # Approve Allowance +/// This transaction body provides a mechanism to add "allowance" entries +/// for an account. These allowances enable one account to spend or transfer +/// token balances (for fungible/common tokens), individual tokens (for +/// non-fungible/unique tokens), or all non-fungible tokens owned by the +/// account, now or in the future (if `approved_for_all` is set). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_approve_allowance.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_create.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_create.grpc.swift new file mode 100644 index 00000000..9b2c462a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_create.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_create.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_delete.grpc.swift new file mode 100644 index 00000000..c7b41a3a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_delete.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Crypto Delete +/// Message to delete an account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_delete_allowance.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_delete_allowance.grpc.swift new file mode 100644 index 00000000..6dfa2373 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_delete_allowance.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Crypto Delete Allowance +/// Delete one or more NFT allowances that permit transfer of tokens from +/// an "owner" account by a different, "spender", account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_delete_allowance.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_delete_live_hash.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_delete_live_hash.grpc.swift new file mode 100644 index 00000000..07a98396 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_delete_live_hash.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Delete Live Hash +/// Dissociate a specific live hash from a specified account. +/// +/// > Important +/// >> This transaction is obsolete and not supported.
+/// >> Any transaction of this type that is submitted SHALL fail with a `PRE_CHECK` result +/// >> of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_delete_live_hash.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_get_account_balance.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_get_account_balance.grpc.swift new file mode 100644 index 00000000..ecbb0ab7 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_get_account_balance.grpc.swift @@ -0,0 +1,24 @@ +///* +/// # Crypto Get Account Balance +/// Query request to obtain balance information for a single account. +/// +/// This query SHOULD NOT be used by client software, queries to a +/// Mirror Node provide more information at much lower cost. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_get_account_balance.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_get_account_records.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_get_account_records.grpc.swift new file mode 100644 index 00000000..8ccf1d03 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_get_account_records.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Crypto Get Account Records +/// Messages for a query to retrieve recent transaction records involving a +/// specified account as effective `payer`.
+/// A "recent" transaction is typically one that reached consensus within +/// the previous three(`3`) minutes of _consensus_ time. Additionally, the +/// network only stores records in state when +/// `ledger.keepRecordsInState=true` was true during transaction handling. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_get_account_records.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_get_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_get_info.grpc.swift new file mode 100644 index 00000000..0d282bd6 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_get_info.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Account Information +/// A standard query to inspect the full detail of an account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_get_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_get_live_hash.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_get_live_hash.grpc.swift new file mode 100644 index 00000000..348368fe --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_get_live_hash.grpc.swift @@ -0,0 +1,27 @@ +///* +/// # Get Live Hash +/// Standard query to inspect associations between content and accounts +/// via SHA-384 hashes. +/// +/// > Important +/// >> This query is obsolete and not supported.
+/// >> Any query of this type that is submitted SHALL fail with a `PRE_CHECK` +/// >> result of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_get_live_hash.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_get_stakers.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_get_stakers.grpc.swift new file mode 100644 index 00000000..b4c7573c --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_get_stakers.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Get Stakers +/// Query all of the accounts proxy staking _to_ a specified account. +/// +/// > Important +/// >> This query is obsolete and not supported.
+/// >> Any query of this type that is submitted SHALL fail with a `PRE_CHECK` +/// >> result of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_get_stakers.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_service.grpc.swift index 8dbf0d23..a810d0e1 100644 --- a/Sources/HieroProtobufs/Generated/services/crypto_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/crypto_service.grpc.swift @@ -1,1699 +1,3448 @@ -// +///* +/// # Crypto Service +/// A service defining transactions and queries related to accounts. +/// +/// This includes transactions for HBAR transfers and balance queries as well as +/// transactions to manage "allowances" which permit a third party to spend a +/// portion of the HBAR balance in an account.
+/// Basic account, record, and receipt queries are also defined in this service. +/// +/// Transactions and queries relating to tokens _other than HBAR_ are defined +/// in the Token Service. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/crypto_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// Transactions and queries for the Hedera Crypto Service. -/// -/// Usage: instantiate `Proto_CryptoServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_CryptoServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? { get } - - func createAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func cryptoTransfer( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func cryptoDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func approveAllowances( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteAllowances( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func addLiveHash( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteLiveHash( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func getLiveHash( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getAccountRecords( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func cryptoGetBalance( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getAccountInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getTransactionReceipts( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getTxRecordByTxID( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.CryptoService + +/// Namespace containing generated types for the "proto.CryptoService" service. +public enum Proto_CryptoService { + /// Service descriptor for the "proto.CryptoService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createAccount" metadata. + public enum createAccount { + /// Request type for "createAccount". + public typealias Input = Proto_Transaction + /// Response type for "createAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "createAccount" + ) + } + /// Namespace for "updateAccount" metadata. + public enum updateAccount { + /// Request type for "updateAccount". + public typealias Input = Proto_Transaction + /// Response type for "updateAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "updateAccount" + ) + } + /// Namespace for "cryptoTransfer" metadata. + public enum cryptoTransfer { + /// Request type for "cryptoTransfer". + public typealias Input = Proto_Transaction + /// Response type for "cryptoTransfer". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "cryptoTransfer". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "cryptoTransfer" + ) + } + /// Namespace for "cryptoDelete" metadata. + public enum cryptoDelete { + /// Request type for "cryptoDelete". + public typealias Input = Proto_Transaction + /// Response type for "cryptoDelete". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "cryptoDelete". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "cryptoDelete" + ) + } + /// Namespace for "approveAllowances" metadata. + public enum approveAllowances { + /// Request type for "approveAllowances". + public typealias Input = Proto_Transaction + /// Response type for "approveAllowances". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "approveAllowances". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "approveAllowances" + ) + } + /// Namespace for "deleteAllowances" metadata. + public enum deleteAllowances { + /// Request type for "deleteAllowances". + public typealias Input = Proto_Transaction + /// Response type for "deleteAllowances". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteAllowances". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "deleteAllowances" + ) + } + /// Namespace for "addLiveHash" metadata. + public enum addLiveHash { + /// Request type for "addLiveHash". + public typealias Input = Proto_Transaction + /// Response type for "addLiveHash". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "addLiveHash". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "addLiveHash" + ) + } + /// Namespace for "deleteLiveHash" metadata. + public enum deleteLiveHash { + /// Request type for "deleteLiveHash". + public typealias Input = Proto_Transaction + /// Response type for "deleteLiveHash". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteLiveHash". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "deleteLiveHash" + ) + } + /// Namespace for "getLiveHash" metadata. + public enum getLiveHash { + /// Request type for "getLiveHash". + public typealias Input = Proto_Query + /// Response type for "getLiveHash". + public typealias Output = Proto_Response + /// Descriptor for "getLiveHash". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "getLiveHash" + ) + } + /// Namespace for "getAccountRecords" metadata. + public enum getAccountRecords { + /// Request type for "getAccountRecords". + public typealias Input = Proto_Query + /// Response type for "getAccountRecords". + public typealias Output = Proto_Response + /// Descriptor for "getAccountRecords". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "getAccountRecords" + ) + } + /// Namespace for "cryptoGetBalance" metadata. + public enum cryptoGetBalance { + /// Request type for "cryptoGetBalance". + public typealias Input = Proto_Query + /// Response type for "cryptoGetBalance". + public typealias Output = Proto_Response + /// Descriptor for "cryptoGetBalance". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "cryptoGetBalance" + ) + } + /// Namespace for "getAccountInfo" metadata. + public enum getAccountInfo { + /// Request type for "getAccountInfo". + public typealias Input = Proto_Query + /// Response type for "getAccountInfo". + public typealias Output = Proto_Response + /// Descriptor for "getAccountInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "getAccountInfo" + ) + } + /// Namespace for "getTransactionReceipts" metadata. + public enum getTransactionReceipts { + /// Request type for "getTransactionReceipts". + public typealias Input = Proto_Query + /// Response type for "getTransactionReceipts". + public typealias Output = Proto_Response + /// Descriptor for "getTransactionReceipts". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "getTransactionReceipts" + ) + } + /// Namespace for "getTxRecordByTxID" metadata. + public enum getTxRecordByTxID { + /// Request type for "getTxRecordByTxID". + public typealias Input = Proto_Query + /// Response type for "getTxRecordByTxID". + public typealias Output = Proto_Response + /// Descriptor for "getTxRecordByTxID". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService"), + method: "getTxRecordByTxID" + ) + } + /// Descriptors for all methods in the "proto.CryptoService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createAccount.descriptor, + updateAccount.descriptor, + cryptoTransfer.descriptor, + cryptoDelete.descriptor, + approveAllowances.descriptor, + deleteAllowances.descriptor, + addLiveHash.descriptor, + deleteLiveHash.descriptor, + getLiveHash.descriptor, + getAccountRecords.descriptor, + cryptoGetBalance.descriptor, + getAccountInfo.descriptor, + getTransactionReceipts.descriptor, + getTxRecordByTxID.descriptor + ] + } } -extension Proto_CryptoServiceClientProtocol { - public var serviceName: String { - return "proto.CryptoService" - } - - ///* - /// Create a new account by submitting the transaction - /// - /// - Parameters: - /// - request: Request to send to createAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.createAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateAccountInterceptors() ?? [] - ) - } - - ///* - /// Update an account by submitting the transaction - /// - /// - Parameters: - /// - request: Request to send to updateAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.updateAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateAccountInterceptors() ?? [] - ) - } - - ///* - /// Initiate a transfer by submitting the transaction - /// - /// - Parameters: - /// - request: Request to send to cryptoTransfer. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func cryptoTransfer( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoTransfer.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoTransferInterceptors() ?? [] - ) - } - - ///* - /// Delete an account by submitting the transaction - /// - /// - Parameters: - /// - request: Request to send to cryptoDelete. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func cryptoDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoDeleteInterceptors() ?? [] - ) - } - - ///* - /// Add one or more approved allowances for spenders to transfer the paying - /// account's hbar or tokens. - /// - /// - Parameters: - /// - request: Request to send to approveAllowances. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func approveAllowances( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.approveAllowances.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeapproveAllowancesInterceptors() ?? [] - ) - } - - ///* - /// Delete one or more of the specific approved NFT serial numbers on an - /// owner account. - /// - /// - Parameters: - /// - request: Request to send to deleteAllowances. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteAllowances( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.deleteAllowances.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteAllowancesInterceptors() ?? [] - ) - } - - ///* - /// Add a livehash - ///

Important
- /// This transaction is obsolete, not supported, and SHALL fail with a - /// pre-check result of `NOT_SUPPORTED`.
- /// - /// - Parameters: - /// - request: Request to send to addLiveHash. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func addLiveHash( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.addLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeaddLiveHashInterceptors() ?? [] - ) - } - - ///* - /// Delete a livehash - ///
Important
- /// This transaction is obsolete, not supported, and SHALL fail with a - /// pre-check result of `NOT_SUPPORTED`.
- /// - /// - Parameters: - /// - request: Request to send to deleteLiveHash. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteLiveHash( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.deleteLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteLiveHashInterceptors() ?? [] - ) - } - - ///* - /// Retrieve a livehash for an account - ///
Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`.
- /// - /// - Parameters: - /// - request: Request to send to getLiveHash. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getLiveHash( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetLiveHashInterceptors() ?? [] - ) - } - - ///* - /// Return all transactions in the last 180s of consensus time for which - /// the given account was the effective payer **and** network property - /// `ledger.keepRecordsInState` was `true`. - /// - /// - Parameters: - /// - request: Request to send to getAccountRecords. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getAccountRecords( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getAccountRecords.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountRecordsInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the balance of an account - /// - /// - Parameters: - /// - request: Request to send to cryptoGetBalance. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func cryptoGetBalance( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoGetBalance.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoGetBalanceInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the metadata of an account - /// - /// - Parameters: - /// - request: Request to send to getAccountInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getAccountInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getAccountInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountInfoInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the latest receipt for a transaction that is either awaiting - /// consensus, or reached consensus in the last 180 seconds - /// - /// - Parameters: - /// - request: Request to send to getTransactionReceipts. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTransactionReceipts( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getTransactionReceipts.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTransactionReceiptsInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the record of a transaction that is either awaiting consensus, - /// or reached consensus in the last 180 seconds - /// - /// - Parameters: - /// - request: Request to send to getTxRecordByTxID. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTxRecordByTxID( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getTxRecordByTxID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTxRecordByTxIDInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.CryptoService" service. + public static let proto_CryptoService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.CryptoService") } -@available(*, deprecated) -extension Proto_CryptoServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_CryptoServiceNIOClient") -public final class Proto_CryptoServiceClient: Proto_CryptoServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.CryptoService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.CryptoService (server) + +extension Proto_CryptoService { + /// Streaming variant of the service protocol for the "proto.CryptoService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Hedera Crypto Service. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func cryptoTransfer( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func cryptoDelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func approveAllowances( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteAllowances( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func addLiveHash( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteLiveHash( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getLiveHash( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getAccountRecords( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func cryptoGetBalance( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getAccountInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getTransactionReceipts( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getTxRecordByTxID( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_CryptoServiceNIOClient: Proto_CryptoServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.CryptoService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.CryptoService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Hedera Crypto Service. + public protocol ServiceProtocol: Proto_CryptoService.StreamingServiceProtocol { + /// Handle the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func cryptoTransfer( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func cryptoDelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func approveAllowances( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteAllowances( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func addLiveHash( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteLiveHash( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getLiveHash( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getAccountRecords( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func cryptoGetBalance( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getAccountInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getTransactionReceipts( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getTxRecordByTxID( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// Transactions and queries for the Hedera Crypto Service. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_CryptoServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCryptoTransferCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCryptoDeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeApproveAllowancesCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteAllowancesCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeAddLiveHashCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteLiveHashCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetLiveHashCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetAccountRecordsCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCryptoGetBalanceCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetAccountInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetTransactionReceiptsCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetTxRecordByTxIDCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.CryptoService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Hedera Crypto Service. + public protocol SimpleServiceProtocol: Proto_CryptoService.ServiceProtocol { + /// Handle the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func cryptoTransfer( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func cryptoDelete( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func approveAllowances( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteAllowances( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func addLiveHash( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteLiveHash( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getLiveHash( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getAccountRecords( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func cryptoGetBalance( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getAccountInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getTransactionReceipts( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getTxRecordByTxID( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_CryptoServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_CryptoServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.createAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateAccountInterceptors() ?? [] - ) - } - - public func makeUpdateAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.updateAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateAccountInterceptors() ?? [] - ) - } - - public func makeCryptoTransferCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoTransfer.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoTransferInterceptors() ?? [] - ) - } - - public func makeCryptoDeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoDeleteInterceptors() ?? [] - ) - } - - public func makeApproveAllowancesCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.approveAllowances.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeapproveAllowancesInterceptors() ?? [] - ) - } - - public func makeDeleteAllowancesCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.deleteAllowances.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteAllowancesInterceptors() ?? [] - ) - } - - public func makeAddLiveHashCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.addLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeaddLiveHashInterceptors() ?? [] - ) - } - - public func makeDeleteLiveHashCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.deleteLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteLiveHashInterceptors() ?? [] - ) - } - - public func makeGetLiveHashCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetLiveHashInterceptors() ?? [] - ) - } - - public func makeGetAccountRecordsCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getAccountRecords.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountRecordsInterceptors() ?? [] - ) - } - - public func makeCryptoGetBalanceCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoGetBalance.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoGetBalanceInterceptors() ?? [] - ) - } - - public func makeGetAccountInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getAccountInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountInfoInterceptors() ?? [] - ) - } - - public func makeGetTransactionReceiptsCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getTransactionReceipts.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTransactionReceiptsInterceptors() ?? [] - ) - } - - public func makeGetTxRecordByTxIDCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getTxRecordByTxID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTxRecordByTxIDInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_CryptoService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_CryptoService.Method.createAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.updateAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.cryptoTransfer.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.cryptoTransfer( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.cryptoDelete.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.cryptoDelete( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.approveAllowances.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.approveAllowances( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.deleteAllowances.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteAllowances( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.addLiveHash.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.addLiveHash( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.deleteLiveHash.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteLiveHash( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.getLiveHash.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getLiveHash( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.getAccountRecords.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getAccountRecords( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.cryptoGetBalance.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.cryptoGetBalance( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.getAccountInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getAccountInfo( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.getTransactionReceipts.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getTransactionReceipts( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_CryptoService.Method.getTxRecordByTxID.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getTxRecordByTxID( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_CryptoServiceAsyncClientProtocol { - public func createAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.createAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateAccountInterceptors() ?? [] - ) - } - - public func updateAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.updateAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateAccountInterceptors() ?? [] - ) - } - - public func cryptoTransfer( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoTransfer.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoTransferInterceptors() ?? [] - ) - } - - public func cryptoDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoDeleteInterceptors() ?? [] - ) - } - - public func approveAllowances( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.approveAllowances.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeapproveAllowancesInterceptors() ?? [] - ) - } - - public func deleteAllowances( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.deleteAllowances.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteAllowancesInterceptors() ?? [] - ) - } - - public func addLiveHash( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.addLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeaddLiveHashInterceptors() ?? [] - ) - } - - public func deleteLiveHash( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.deleteLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteLiveHashInterceptors() ?? [] - ) - } - - public func getLiveHash( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getLiveHash.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetLiveHashInterceptors() ?? [] - ) - } - - public func getAccountRecords( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getAccountRecords.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountRecordsInterceptors() ?? [] - ) - } - - public func cryptoGetBalance( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.cryptoGetBalance.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecryptoGetBalanceInterceptors() ?? [] - ) - } - - public func getAccountInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getAccountInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountInfoInterceptors() ?? [] - ) - } - - public func getTransactionReceipts( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getTransactionReceipts.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTransactionReceiptsInterceptors() ?? [] - ) - } - - public func getTxRecordByTxID( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_CryptoServiceClientMetadata.Methods.getTxRecordByTxID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTxRecordByTxIDInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_CryptoService.ServiceProtocol { + public func createAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_CryptoServiceAsyncClient: Proto_CryptoServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_CryptoServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func updateAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func cryptoTransfer( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.cryptoTransfer( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_CryptoServiceClientInterceptorFactoryProtocol: Sendable { + public func cryptoDelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.cryptoDelete( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func approveAllowances( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.approveAllowances( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'createAccount'. - func makecreateAccountInterceptors() -> [ClientInterceptor] + public func deleteAllowances( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteAllowances( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'updateAccount'. - func makeupdateAccountInterceptors() -> [ClientInterceptor] + public func addLiveHash( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.addLiveHash( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'cryptoTransfer'. - func makecryptoTransferInterceptors() -> [ClientInterceptor] + public func deleteLiveHash( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteLiveHash( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'cryptoDelete'. - func makecryptoDeleteInterceptors() -> [ClientInterceptor] + public func getLiveHash( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getLiveHash( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'approveAllowances'. - func makeapproveAllowancesInterceptors() -> [ClientInterceptor] + public func getAccountRecords( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getAccountRecords( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'deleteAllowances'. - func makedeleteAllowancesInterceptors() -> [ClientInterceptor] + public func cryptoGetBalance( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.cryptoGetBalance( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'addLiveHash'. - func makeaddLiveHashInterceptors() -> [ClientInterceptor] + public func getAccountInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getAccountInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'deleteLiveHash'. - func makedeleteLiveHashInterceptors() -> [ClientInterceptor] + public func getTransactionReceipts( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getTransactionReceipts( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'getLiveHash'. - func makegetLiveHashInterceptors() -> [ClientInterceptor] + public func getTxRecordByTxID( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getTxRecordByTxID( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'getAccountRecords'. - func makegetAccountRecordsInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_CryptoService.SimpleServiceProtocol { + public func createAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'cryptoGetBalance'. - func makecryptoGetBalanceInterceptors() -> [ClientInterceptor] + public func updateAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getAccountInfo'. - func makegetAccountInfoInterceptors() -> [ClientInterceptor] + public func cryptoTransfer( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.cryptoTransfer( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getTransactionReceipts'. - func makegetTransactionReceiptsInterceptors() -> [ClientInterceptor] + public func cryptoDelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.cryptoDelete( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getTxRecordByTxID'. - func makegetTxRecordByTxIDInterceptors() -> [ClientInterceptor] -} + public func approveAllowances( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.approveAllowances( + request: request.message, + context: context + ), + metadata: [:] + ) + } -public enum Proto_CryptoServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "CryptoService", - fullName: "proto.CryptoService", - methods: [ - Proto_CryptoServiceClientMetadata.Methods.createAccount, - Proto_CryptoServiceClientMetadata.Methods.updateAccount, - Proto_CryptoServiceClientMetadata.Methods.cryptoTransfer, - Proto_CryptoServiceClientMetadata.Methods.cryptoDelete, - Proto_CryptoServiceClientMetadata.Methods.approveAllowances, - Proto_CryptoServiceClientMetadata.Methods.deleteAllowances, - Proto_CryptoServiceClientMetadata.Methods.addLiveHash, - Proto_CryptoServiceClientMetadata.Methods.deleteLiveHash, - Proto_CryptoServiceClientMetadata.Methods.getLiveHash, - Proto_CryptoServiceClientMetadata.Methods.getAccountRecords, - Proto_CryptoServiceClientMetadata.Methods.cryptoGetBalance, - Proto_CryptoServiceClientMetadata.Methods.getAccountInfo, - Proto_CryptoServiceClientMetadata.Methods.getTransactionReceipts, - Proto_CryptoServiceClientMetadata.Methods.getTxRecordByTxID, - ] - ) - - public enum Methods { - public static let createAccount = GRPCMethodDescriptor( - name: "createAccount", - path: "/proto.CryptoService/createAccount", - type: GRPCCallType.unary - ) - - public static let updateAccount = GRPCMethodDescriptor( - name: "updateAccount", - path: "/proto.CryptoService/updateAccount", - type: GRPCCallType.unary - ) - - public static let cryptoTransfer = GRPCMethodDescriptor( - name: "cryptoTransfer", - path: "/proto.CryptoService/cryptoTransfer", - type: GRPCCallType.unary - ) - - public static let cryptoDelete = GRPCMethodDescriptor( - name: "cryptoDelete", - path: "/proto.CryptoService/cryptoDelete", - type: GRPCCallType.unary - ) - - public static let approveAllowances = GRPCMethodDescriptor( - name: "approveAllowances", - path: "/proto.CryptoService/approveAllowances", - type: GRPCCallType.unary - ) - - public static let deleteAllowances = GRPCMethodDescriptor( - name: "deleteAllowances", - path: "/proto.CryptoService/deleteAllowances", - type: GRPCCallType.unary - ) - - public static let addLiveHash = GRPCMethodDescriptor( - name: "addLiveHash", - path: "/proto.CryptoService/addLiveHash", - type: GRPCCallType.unary - ) - - public static let deleteLiveHash = GRPCMethodDescriptor( - name: "deleteLiveHash", - path: "/proto.CryptoService/deleteLiveHash", - type: GRPCCallType.unary - ) - - public static let getLiveHash = GRPCMethodDescriptor( - name: "getLiveHash", - path: "/proto.CryptoService/getLiveHash", - type: GRPCCallType.unary - ) - - public static let getAccountRecords = GRPCMethodDescriptor( - name: "getAccountRecords", - path: "/proto.CryptoService/getAccountRecords", - type: GRPCCallType.unary - ) - - public static let cryptoGetBalance = GRPCMethodDescriptor( - name: "cryptoGetBalance", - path: "/proto.CryptoService/cryptoGetBalance", - type: GRPCCallType.unary - ) - - public static let getAccountInfo = GRPCMethodDescriptor( - name: "getAccountInfo", - path: "/proto.CryptoService/getAccountInfo", - type: GRPCCallType.unary - ) - - public static let getTransactionReceipts = GRPCMethodDescriptor( - name: "getTransactionReceipts", - path: "/proto.CryptoService/getTransactionReceipts", - type: GRPCCallType.unary - ) - - public static let getTxRecordByTxID = GRPCMethodDescriptor( - name: "getTxRecordByTxID", - path: "/proto.CryptoService/getTxRecordByTxID", - type: GRPCCallType.unary - ) - } -} + public func deleteAllowances( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteAllowances( + request: request.message, + context: context + ), + metadata: [:] + ) + } -///* -/// Transactions and queries for the Hedera Crypto Service. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_CryptoServiceProvider: CallHandlerProvider { - var interceptors: Proto_CryptoServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new account by submitting the transaction - func createAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Update an account by submitting the transaction - func updateAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Initiate a transfer by submitting the transaction - func cryptoTransfer(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete an account by submitting the transaction - func cryptoDelete(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Add one or more approved allowances for spenders to transfer the paying - /// account's hbar or tokens. - func approveAllowances(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete one or more of the specific approved NFT serial numbers on an - /// owner account. - func deleteAllowances(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Add a livehash - ///
Important
- /// This transaction is obsolete, not supported, and SHALL fail with a - /// pre-check result of `NOT_SUPPORTED`.
- func addLiveHash(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete a livehash - ///
Important
- /// This transaction is obsolete, not supported, and SHALL fail with a - /// pre-check result of `NOT_SUPPORTED`.
- func deleteLiveHash(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve a livehash for an account - ///
Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`.
- func getLiveHash(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Return all transactions in the last 180s of consensus time for which - /// the given account was the effective payer **and** network property - /// `ledger.keepRecordsInState` was `true`. - func getAccountRecords(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the balance of an account - func cryptoGetBalance(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the metadata of an account - func getAccountInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the latest receipt for a transaction that is either awaiting - /// consensus, or reached consensus in the last 180 seconds - func getTransactionReceipts(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the record of a transaction that is either awaiting consensus, - /// or reached consensus in the last 180 seconds - func getTxRecordByTxID(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture -} + public func addLiveHash( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.addLiveHash( + request: request.message, + context: context + ), + metadata: [:] + ) + } -extension Proto_CryptoServiceProvider { - public var serviceName: Substring { - return Proto_CryptoServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateAccountInterceptors() ?? [], - userFunction: self.createAccount(request:context:) - ) - - case "updateAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateAccountInterceptors() ?? [], - userFunction: self.updateAccount(request:context:) - ) - - case "cryptoTransfer": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecryptoTransferInterceptors() ?? [], - userFunction: self.cryptoTransfer(request:context:) - ) - - case "cryptoDelete": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecryptoDeleteInterceptors() ?? [], - userFunction: self.cryptoDelete(request:context:) - ) - - case "approveAllowances": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeapproveAllowancesInterceptors() ?? [], - userFunction: self.approveAllowances(request:context:) - ) - - case "deleteAllowances": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteAllowancesInterceptors() ?? [], - userFunction: self.deleteAllowances(request:context:) - ) - - case "addLiveHash": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeaddLiveHashInterceptors() ?? [], - userFunction: self.addLiveHash(request:context:) - ) - - case "deleteLiveHash": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteLiveHashInterceptors() ?? [], - userFunction: self.deleteLiveHash(request:context:) - ) - - case "getLiveHash": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetLiveHashInterceptors() ?? [], - userFunction: self.getLiveHash(request:context:) - ) - - case "getAccountRecords": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetAccountRecordsInterceptors() ?? [], - userFunction: self.getAccountRecords(request:context:) - ) - - case "cryptoGetBalance": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecryptoGetBalanceInterceptors() ?? [], - userFunction: self.cryptoGetBalance(request:context:) - ) - - case "getAccountInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetAccountInfoInterceptors() ?? [], - userFunction: self.getAccountInfo(request:context:) - ) - - case "getTransactionReceipts": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTransactionReceiptsInterceptors() ?? [], - userFunction: self.getTransactionReceipts(request:context:) - ) - - case "getTxRecordByTxID": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTxRecordByTxIDInterceptors() ?? [], - userFunction: self.getTxRecordByTxID(request:context:) - ) - - default: - return nil + public func deleteLiveHash( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteLiveHash( + request: request.message, + context: context + ), + metadata: [:] + ) } - } -} -///* -/// Transactions and queries for the Hedera Crypto Service. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_CryptoServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_CryptoServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new account by submitting the transaction - func createAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Update an account by submitting the transaction - func updateAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Initiate a transfer by submitting the transaction - func cryptoTransfer( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete an account by submitting the transaction - func cryptoDelete( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Add one or more approved allowances for spenders to transfer the paying - /// account's hbar or tokens. - func approveAllowances( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete one or more of the specific approved NFT serial numbers on an - /// owner account. - func deleteAllowances( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Add a livehash - ///
Important
- /// This transaction is obsolete, not supported, and SHALL fail with a - /// pre-check result of `NOT_SUPPORTED`.
- func addLiveHash( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete a livehash - ///
Important
- /// This transaction is obsolete, not supported, and SHALL fail with a - /// pre-check result of `NOT_SUPPORTED`.
- func deleteLiveHash( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Retrieve a livehash for an account - ///
Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`.
- func getLiveHash( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Return all transactions in the last 180s of consensus time for which - /// the given account was the effective payer **and** network property - /// `ledger.keepRecordsInState` was `true`. - func getAccountRecords( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the balance of an account - func cryptoGetBalance( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the metadata of an account - func getAccountInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the latest receipt for a transaction that is either awaiting - /// consensus, or reached consensus in the last 180 seconds - func getTransactionReceipts( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the record of a transaction that is either awaiting consensus, - /// or reached consensus in the last 180 seconds - func getTxRecordByTxID( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response -} + public func getLiveHash( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getLiveHash( + request: request.message, + context: context + ), + metadata: [:] + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_CryptoServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_CryptoServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_CryptoServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_CryptoServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateAccountInterceptors() ?? [], - wrapping: { try await self.createAccount(request: $0, context: $1) } - ) - - case "updateAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateAccountInterceptors() ?? [], - wrapping: { try await self.updateAccount(request: $0, context: $1) } - ) - - case "cryptoTransfer": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecryptoTransferInterceptors() ?? [], - wrapping: { try await self.cryptoTransfer(request: $0, context: $1) } - ) - - case "cryptoDelete": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecryptoDeleteInterceptors() ?? [], - wrapping: { try await self.cryptoDelete(request: $0, context: $1) } - ) - - case "approveAllowances": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeapproveAllowancesInterceptors() ?? [], - wrapping: { try await self.approveAllowances(request: $0, context: $1) } - ) - - case "deleteAllowances": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteAllowancesInterceptors() ?? [], - wrapping: { try await self.deleteAllowances(request: $0, context: $1) } - ) - - case "addLiveHash": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeaddLiveHashInterceptors() ?? [], - wrapping: { try await self.addLiveHash(request: $0, context: $1) } - ) - - case "deleteLiveHash": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteLiveHashInterceptors() ?? [], - wrapping: { try await self.deleteLiveHash(request: $0, context: $1) } - ) - - case "getLiveHash": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetLiveHashInterceptors() ?? [], - wrapping: { try await self.getLiveHash(request: $0, context: $1) } - ) - - case "getAccountRecords": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetAccountRecordsInterceptors() ?? [], - wrapping: { try await self.getAccountRecords(request: $0, context: $1) } - ) - - case "cryptoGetBalance": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecryptoGetBalanceInterceptors() ?? [], - wrapping: { try await self.cryptoGetBalance(request: $0, context: $1) } - ) - - case "getAccountInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetAccountInfoInterceptors() ?? [], - wrapping: { try await self.getAccountInfo(request: $0, context: $1) } - ) - - case "getTransactionReceipts": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTransactionReceiptsInterceptors() ?? [], - wrapping: { try await self.getTransactionReceipts(request: $0, context: $1) } - ) - - case "getTxRecordByTxID": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTxRecordByTxIDInterceptors() ?? [], - wrapping: { try await self.getTxRecordByTxID(request: $0, context: $1) } - ) - - default: - return nil + public func getAccountRecords( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getAccountRecords( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func cryptoGetBalance( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.cryptoGetBalance( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func getAccountInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getAccountInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func getTransactionReceipts( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getTransactionReceipts( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func getTxRecordByTxID( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getTxRecordByTxID( + request: request.message, + context: context + ), + metadata: [:] + ) } - } } -public protocol Proto_CryptoServiceServerInterceptorFactoryProtocol: Sendable { +// MARK: proto.CryptoService (client) + +extension Proto_CryptoService { + /// Generated client protocol for the "proto.CryptoService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Hedera Crypto Service. + public protocol ClientProtocol: Sendable { + /// Call the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func cryptoTransfer( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func cryptoDelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func approveAllowances( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteAllowances( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func addLiveHash( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteLiveHash( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getLiveHash( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getAccountRecords( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func cryptoGetBalance( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getAccountInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getTransactionReceipts( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getTxRecordByTxID( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } - /// - Returns: Interceptors to use when handling 'createAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateAccountInterceptors() -> [ServerInterceptor] + /// Generated client for the "proto.CryptoService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Hedera Crypto Service. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.createAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.updateAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoTransfer( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.cryptoTransfer.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoDelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.cryptoDelete.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func approveAllowances( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.approveAllowances.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteAllowances( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.deleteAllowances.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func addLiveHash( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.addLiveHash.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteLiveHash( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.deleteLiveHash.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getLiveHash( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.getLiveHash.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountRecords( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.getAccountRecords.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoGetBalance( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.cryptoGetBalance.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.getAccountInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTransactionReceipts( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.getTransactionReceipts.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTxRecordByTxID( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_CryptoService.Method.getTxRecordByTxID.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + } +} - /// - Returns: Interceptors to use when handling 'updateAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateAccountInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_CryptoService.ClientProtocol { + /// Call the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'cryptoTransfer'. - /// Defaults to calling `self.makeInterceptors()`. - func makecryptoTransferInterceptors() -> [ServerInterceptor] + /// Call the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'cryptoDelete'. - /// Defaults to calling `self.makeInterceptors()`. - func makecryptoDeleteInterceptors() -> [ServerInterceptor] + /// Call the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoTransfer( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.cryptoTransfer( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'approveAllowances'. - /// Defaults to calling `self.makeInterceptors()`. - func makeapproveAllowancesInterceptors() -> [ServerInterceptor] + /// Call the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoDelete( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.cryptoDelete( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteAllowances'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteAllowancesInterceptors() -> [ServerInterceptor] + /// Call the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func approveAllowances( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.approveAllowances( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'addLiveHash'. - /// Defaults to calling `self.makeInterceptors()`. - func makeaddLiveHashInterceptors() -> [ServerInterceptor] + /// Call the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteAllowances( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteAllowances( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteLiveHash'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteLiveHashInterceptors() -> [ServerInterceptor] + /// Call the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func addLiveHash( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.addLiveHash( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getLiveHash'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetLiveHashInterceptors() -> [ServerInterceptor] + /// Call the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteLiveHash( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteLiveHash( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getAccountRecords'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetAccountRecordsInterceptors() -> [ServerInterceptor] + /// Call the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getLiveHash( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getLiveHash( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'cryptoGetBalance'. - /// Defaults to calling `self.makeInterceptors()`. - func makecryptoGetBalanceInterceptors() -> [ServerInterceptor] + /// Call the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountRecords( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getAccountRecords( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getAccountInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetAccountInfoInterceptors() -> [ServerInterceptor] + /// Call the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoGetBalance( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.cryptoGetBalance( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getTransactionReceipts'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetTransactionReceiptsInterceptors() -> [ServerInterceptor] + /// Call the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getAccountInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getTxRecordByTxID'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetTxRecordByTxIDInterceptors() -> [ServerInterceptor] -} + /// Call the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTransactionReceipts( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getTransactionReceipts( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -public enum Proto_CryptoServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "CryptoService", - fullName: "proto.CryptoService", - methods: [ - Proto_CryptoServiceServerMetadata.Methods.createAccount, - Proto_CryptoServiceServerMetadata.Methods.updateAccount, - Proto_CryptoServiceServerMetadata.Methods.cryptoTransfer, - Proto_CryptoServiceServerMetadata.Methods.cryptoDelete, - Proto_CryptoServiceServerMetadata.Methods.approveAllowances, - Proto_CryptoServiceServerMetadata.Methods.deleteAllowances, - Proto_CryptoServiceServerMetadata.Methods.addLiveHash, - Proto_CryptoServiceServerMetadata.Methods.deleteLiveHash, - Proto_CryptoServiceServerMetadata.Methods.getLiveHash, - Proto_CryptoServiceServerMetadata.Methods.getAccountRecords, - Proto_CryptoServiceServerMetadata.Methods.cryptoGetBalance, - Proto_CryptoServiceServerMetadata.Methods.getAccountInfo, - Proto_CryptoServiceServerMetadata.Methods.getTransactionReceipts, - Proto_CryptoServiceServerMetadata.Methods.getTxRecordByTxID, - ] - ) - - public enum Methods { - public static let createAccount = GRPCMethodDescriptor( - name: "createAccount", - path: "/proto.CryptoService/createAccount", - type: GRPCCallType.unary - ) - - public static let updateAccount = GRPCMethodDescriptor( - name: "updateAccount", - path: "/proto.CryptoService/updateAccount", - type: GRPCCallType.unary - ) - - public static let cryptoTransfer = GRPCMethodDescriptor( - name: "cryptoTransfer", - path: "/proto.CryptoService/cryptoTransfer", - type: GRPCCallType.unary - ) - - public static let cryptoDelete = GRPCMethodDescriptor( - name: "cryptoDelete", - path: "/proto.CryptoService/cryptoDelete", - type: GRPCCallType.unary - ) - - public static let approveAllowances = GRPCMethodDescriptor( - name: "approveAllowances", - path: "/proto.CryptoService/approveAllowances", - type: GRPCCallType.unary - ) - - public static let deleteAllowances = GRPCMethodDescriptor( - name: "deleteAllowances", - path: "/proto.CryptoService/deleteAllowances", - type: GRPCCallType.unary - ) - - public static let addLiveHash = GRPCMethodDescriptor( - name: "addLiveHash", - path: "/proto.CryptoService/addLiveHash", - type: GRPCCallType.unary - ) - - public static let deleteLiveHash = GRPCMethodDescriptor( - name: "deleteLiveHash", - path: "/proto.CryptoService/deleteLiveHash", - type: GRPCCallType.unary - ) - - public static let getLiveHash = GRPCMethodDescriptor( - name: "getLiveHash", - path: "/proto.CryptoService/getLiveHash", - type: GRPCCallType.unary - ) - - public static let getAccountRecords = GRPCMethodDescriptor( - name: "getAccountRecords", - path: "/proto.CryptoService/getAccountRecords", - type: GRPCCallType.unary - ) - - public static let cryptoGetBalance = GRPCMethodDescriptor( - name: "cryptoGetBalance", - path: "/proto.CryptoService/cryptoGetBalance", - type: GRPCCallType.unary - ) - - public static let getAccountInfo = GRPCMethodDescriptor( - name: "getAccountInfo", - path: "/proto.CryptoService/getAccountInfo", - type: GRPCCallType.unary - ) - - public static let getTransactionReceipts = GRPCMethodDescriptor( - name: "getTransactionReceipts", - path: "/proto.CryptoService/getTransactionReceipts", - type: GRPCCallType.unary - ) - - public static let getTxRecordByTxID = GRPCMethodDescriptor( - name: "getTxRecordByTxID", - path: "/proto.CryptoService/getTxRecordByTxID", - type: GRPCCallType.unary - ) - } + /// Call the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTxRecordByTxID( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getTxRecordByTxID( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } + +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_CryptoService.ClientProtocol { + /// Call the "createAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new account by submitting the transaction + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update an account by submitting the transaction + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cryptoTransfer" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Initiate a transfer by submitting the transaction + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoTransfer( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.cryptoTransfer( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cryptoDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete an account by submitting the transaction + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoDelete( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.cryptoDelete( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "approveAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add one or more approved allowances for spenders to transfer the paying + /// > account's hbar or tokens. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func approveAllowances( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.approveAllowances( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteAllowances" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete one or more of the specific approved NFT serial numbers on an + /// > owner account. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteAllowances( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteAllowances( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "addLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func addLiveHash( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.addLiveHash( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a livehash + /// >
Important
+ /// > This transaction is obsolete, not supported, and SHALL fail with a + /// > pre-check result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteLiveHash( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteLiveHash( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getLiveHash" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve a livehash for an account + /// >
Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getLiveHash( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getLiveHash( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getAccountRecords" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Return all transactions in the last 180s of consensus time for which + /// > the given account was the effective payer **and** network property + /// > `ledger.keepRecordsInState` was `true`. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountRecords( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getAccountRecords( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cryptoGetBalance" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the balance of an account + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cryptoGetBalance( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.cryptoGetBalance( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getAccountInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata of an account + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getAccountInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTransactionReceipts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the latest receipt for a transaction that is either awaiting + /// > consensus, or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTransactionReceipts( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getTransactionReceipts( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTxRecordByTxID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the record of a transaction that is either awaiting consensus, + /// > or reached consensus in the last 180 seconds + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTxRecordByTxID( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getTxRecordByTxID( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_transfer.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_transfer.grpc.swift new file mode 100644 index 00000000..99bacdcf --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_transfer.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_transfer.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/crypto_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/crypto_update.grpc.swift new file mode 100644 index 00000000..b089f741 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/crypto_update.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Crypto Update +/// Modify a single account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/crypto_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/custom_fees.grpc.swift b/Sources/HieroProtobufs/Generated/services/custom_fees.grpc.swift new file mode 100644 index 00000000..dce6273a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/custom_fees.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/custom_fees.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/duration.grpc.swift b/Sources/HieroProtobufs/Generated/services/duration.grpc.swift new file mode 100644 index 00000000..ac092f51 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/duration.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/duration.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/ethereum_transaction.grpc.swift b/Sources/HieroProtobufs/Generated/services/ethereum_transaction.grpc.swift new file mode 100644 index 00000000..a80d5dec --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/ethereum_transaction.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Ethereum Call +/// Make an Ethereum transaction "call" with all data in Ethereum formats, +/// including the contract alias. Call data may be in the transaction, +/// or stored within an Hedera File.
+/// The caller MAY offer additional gas above what is offered in the call +/// data, but MAY be charged up to 80% of that value if the amount required +/// is less than this "floor" amount. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/ethereum_transaction.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/exchange_rate.grpc.swift b/Sources/HieroProtobufs/Generated/services/exchange_rate.grpc.swift new file mode 100644 index 00000000..b5d56795 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/exchange_rate.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Exchange Rates +/// Exchange rates that define ratios between HBAR and USD. +/// +/// Fees are denominated in USD, but paid in HBAR, so accurate exchange +/// rates are important and the exchange rates kept in state are updated +/// frequently.
+/// Exchange rates are also reported in every receipt for fee transparency. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/exchange_rate.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_append.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_append.grpc.swift new file mode 100644 index 00000000..7d61ed62 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/file_append.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # File Append +/// A transaction body message to append data to a "file" in state. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/file_append.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_create.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_create.grpc.swift new file mode 100644 index 00000000..07a3fa89 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/file_create.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # File Create +/// Messages to create a new file entry. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/file_create.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_delete.grpc.swift new file mode 100644 index 00000000..7f3cc61c --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/file_delete.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # File Delete +/// A message for a transaction to delete a file. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/file_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_get_contents.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_get_contents.grpc.swift new file mode 100644 index 00000000..234e422c --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/file_get_contents.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # File Get Contents +/// Messages for a query to retrieve the content of a file in the +/// Hedera File Service (HFS). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/file_get_contents.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_get_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_get_info.grpc.swift new file mode 100644 index 00000000..3d0d094e --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/file_get_info.grpc.swift @@ -0,0 +1,24 @@ +///* +/// # File Get Information +/// Messages for a query to retrieve the metadata for a file in the +/// Hedera File Service (HFS). +/// +/// The query defined here does not include the content of the file. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/file_get_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_service.grpc.swift index 9604bdca..51695edd 100644 --- a/Sources/HieroProtobufs/Generated/services/file_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/file_service.grpc.swift @@ -1,1207 +1,2280 @@ -// +///* +/// # File Service +/// gRPC definitions for the Hedera File Service (HFS). +/// +/// The HFS manages bulk data in the form of byte arrays of arbitrary +/// size, up to a network-configured maximum size. These files are +/// most often used to store bulk data for distributed applications +/// 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/file_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// Service gRPC definitions for the Hedera File Service (HFS). -/// -/// #### Signature Requirements -/// The HFS manages file authorization differently, depending on type of file -/// transaction, and this can be surprising.
-/// The core element of file authorization is the `keys` field, -/// which is a `KeyList`; a list of individual `Key` messages, each of which -/// may represent a simple or complex key.
-/// The file service transactions treat this list differently.
-/// A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature -/// from _each_ key in the list.
-/// A `fileDelete` MUST have a valid signature from _at least one_ key in -/// the list. This is different, and allows a file "owned" by many entities -/// to be deleted by any one of those entities. A deleted file cannot be -/// restored, so it is important to consider this when assigning keys for -/// a file.
-/// If any of the keys in a `KeyList` are complex, the full requirements of -/// each complex key must be met to count as a "valid signature" for that key. -/// A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly -/// including additional `ThresholdKey` or `KeyList` descendants) may be -/// assigned as the sole entry in a file `keys` field to ensure all transactions -/// have the same signature requirements. -/// -/// Usage: instantiate `Proto_FileServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_FileServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? { get } - - func createFile( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateFile( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteFile( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func appendContent( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func getFileContent( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getFileInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func systemDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func systemUndelete( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.FileService + +/// Namespace containing generated types for the "proto.FileService" service. +public enum Proto_FileService { + /// Service descriptor for the "proto.FileService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createFile" metadata. + public enum createFile { + /// Request type for "createFile". + public typealias Input = Proto_Transaction + /// Response type for "createFile". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createFile". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "createFile" + ) + } + /// Namespace for "updateFile" metadata. + public enum updateFile { + /// Request type for "updateFile". + public typealias Input = Proto_Transaction + /// Response type for "updateFile". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateFile". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "updateFile" + ) + } + /// Namespace for "deleteFile" metadata. + public enum deleteFile { + /// Request type for "deleteFile". + public typealias Input = Proto_Transaction + /// Response type for "deleteFile". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteFile". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "deleteFile" + ) + } + /// Namespace for "appendContent" metadata. + public enum appendContent { + /// Request type for "appendContent". + public typealias Input = Proto_Transaction + /// Response type for "appendContent". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "appendContent". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "appendContent" + ) + } + /// Namespace for "getFileContent" metadata. + public enum getFileContent { + /// Request type for "getFileContent". + public typealias Input = Proto_Query + /// Response type for "getFileContent". + public typealias Output = Proto_Response + /// Descriptor for "getFileContent". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "getFileContent" + ) + } + /// Namespace for "getFileInfo" metadata. + public enum getFileInfo { + /// Request type for "getFileInfo". + public typealias Input = Proto_Query + /// Response type for "getFileInfo". + public typealias Output = Proto_Response + /// Descriptor for "getFileInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "getFileInfo" + ) + } + /// Namespace for "systemDelete" metadata. + public enum systemDelete { + /// Request type for "systemDelete". + public typealias Input = Proto_Transaction + /// Response type for "systemDelete". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "systemDelete". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "systemDelete" + ) + } + /// Namespace for "systemUndelete" metadata. + public enum systemUndelete { + /// Request type for "systemUndelete". + public typealias Input = Proto_Transaction + /// Response type for "systemUndelete". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "systemUndelete". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService"), + method: "systemUndelete" + ) + } + /// Descriptors for all methods in the "proto.FileService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createFile.descriptor, + updateFile.descriptor, + deleteFile.descriptor, + appendContent.descriptor, + getFileContent.descriptor, + getFileInfo.descriptor, + systemDelete.descriptor, + systemUndelete.descriptor + ] + } } -extension Proto_FileServiceClientProtocol { - public var serviceName: String { - return "proto.FileService" - } - - ///* - /// Create a file in HFS. - /// - /// - Parameters: - /// - request: Request to send to createFile. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createFile( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.createFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateFileInterceptors() ?? [] - ) - } - - ///* - /// Update a file in HFS. - /// - /// - Parameters: - /// - request: Request to send to updateFile. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateFile( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.updateFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateFileInterceptors() ?? [] - ) - } - - ///* - /// Delete a file in HFS.
- /// The content of a file deleted in this manner is completely removed - /// from network state, but the file metadata remains. - /// - /// - Parameters: - /// - request: Request to send to deleteFile. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteFile( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.deleteFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteFileInterceptors() ?? [] - ) - } - - ///* - /// Append content to a file in HFS. - /// - /// - Parameters: - /// - request: Request to send to appendContent. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func appendContent( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.appendContent.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeappendContentInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the content of a file in HFS.
- /// Note that this query retrieves _only_ the file content, not any of - /// the metadata for the file. - /// - /// - Parameters: - /// - request: Request to send to getFileContent. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getFileContent( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.getFileContent.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetFileContentInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the metadata for a file in HFS.
- /// Note that this query does not retrieve the file _content_. - /// - /// - Parameters: - /// - request: Request to send to getFileInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getFileInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.getFileInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetFileInfoInterceptors() ?? [] - ) - } - - ///* - /// Delete a "regular" file without "owner" authorization.
- /// This transaction _does not_ require signatures for the keys in - /// the file `keys` list, but must be signed by a "privileged" account. - ///

- /// This transaction SHALL NOT accept a file identifier for - /// a "system" file.
- /// This transaction SHALL NOT remove the _content_ of the file from state. - /// This permits use of the `systemUndelete` to reverse this action if - /// performed in error. - ///

- /// This is a privileged transaction, and only accounts 2-59 are permitted - /// to call this function, by default. The actual restriction is in the - /// `api-permission.properties` file in the consensus node configuration. - /// - /// - Parameters: - /// - request: Request to send to systemDelete. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func systemDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.systemDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [] - ) - } - - ///* - /// Undelete a "regular" file. - /// This transaction must be signed by a "privileged" account.
- ///

- /// This transaction SHALL NOT accept a file identifier for - /// a "system" file.
- /// The file identified SHOULD have been previously deleted.
- /// This transaction SHALL NOT recover the _content_ of a file unless that - /// file was deleted with a `systemDelete` transaction. The _content_ of a - /// file deleted with a `fileDelete` transaction is not retained in state. - ///

- /// This is a privileged transaction, and only accounts 2-60 are permitted - /// to call this function, by default. The actual restriction is in the - /// `api-permission.properties` file in the consensus node configuration. - /// - /// - Parameters: - /// - request: Request to send to systemUndelete. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func systemUndelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.systemUndelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.FileService" service. + public static let proto_FileService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FileService") } -@available(*, deprecated) -extension Proto_FileServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_FileServiceNIOClient") -public final class Proto_FileServiceClient: Proto_FileServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.FileService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.FileService (server) + +extension Proto_FileService { + /// Streaming variant of the service protocol for the "proto.FileService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Service gRPC definitions for the Hedera File Service (HFS). + /// > + /// > #### Signature Requirements + /// > The HFS manages file authorization differently, depending on type of file + /// > transaction, and this can be surprising.
+ /// > The core element of file authorization is the `keys` field, + /// > which is a `KeyList`; a list of individual `Key` messages, each of which + /// > may represent a simple or complex key.
+ /// > The file service transactions treat this list differently.
+ /// > A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature + /// > from _each_ key in the list.
+ /// > A `fileDelete` MUST have a valid signature from _at least one_ key in + /// > the list. This is different, and allows a file "owned" by many entities + /// > to be deleted by any one of those entities. A deleted file cannot be + /// > restored, so it is important to consider this when assigning keys for + /// > a file.
+ /// > If any of the keys in a `KeyList` are complex, the full requirements of + /// > each complex key must be met to count as a "valid signature" for that key. + /// > A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly + /// > including additional `ThresholdKey` or `KeyList` descendants) may be + /// > assigned as the sole entry in a file `keys` field to ensure all transactions + /// > have the same signature requirements. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createFile( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateFile( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteFile( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func appendContent( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getFileContent( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getFileInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func systemDelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func systemUndelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_FileServiceNIOClient: Proto_FileServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.FileService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.FileService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Service gRPC definitions for the Hedera File Service (HFS). + /// > + /// > #### Signature Requirements + /// > The HFS manages file authorization differently, depending on type of file + /// > transaction, and this can be surprising.
+ /// > The core element of file authorization is the `keys` field, + /// > which is a `KeyList`; a list of individual `Key` messages, each of which + /// > may represent a simple or complex key.
+ /// > The file service transactions treat this list differently.
+ /// > A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature + /// > from _each_ key in the list.
+ /// > A `fileDelete` MUST have a valid signature from _at least one_ key in + /// > the list. This is different, and allows a file "owned" by many entities + /// > to be deleted by any one of those entities. A deleted file cannot be + /// > restored, so it is important to consider this when assigning keys for + /// > a file.
+ /// > If any of the keys in a `KeyList` are complex, the full requirements of + /// > each complex key must be met to count as a "valid signature" for that key. + /// > A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly + /// > including additional `ThresholdKey` or `KeyList` descendants) may be + /// > assigned as the sole entry in a file `keys` field to ensure all transactions + /// > have the same signature requirements. + public protocol ServiceProtocol: Proto_FileService.StreamingServiceProtocol { + /// Handle the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createFile( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateFile( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteFile( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func appendContent( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getFileContent( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getFileInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func systemDelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func systemUndelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// Service gRPC definitions for the Hedera File Service (HFS). -/// -/// #### Signature Requirements -/// The HFS manages file authorization differently, depending on type of file -/// transaction, and this can be surprising.
-/// The core element of file authorization is the `keys` field, -/// which is a `KeyList`; a list of individual `Key` messages, each of which -/// may represent a simple or complex key.
-/// The file service transactions treat this list differently.
-/// A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature -/// from _each_ key in the list.
-/// A `fileDelete` MUST have a valid signature from _at least one_ key in -/// the list. This is different, and allows a file "owned" by many entities -/// to be deleted by any one of those entities. A deleted file cannot be -/// restored, so it is important to consider this when assigning keys for -/// a file.
-/// If any of the keys in a `KeyList` are complex, the full requirements of -/// each complex key must be met to count as a "valid signature" for that key. -/// A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly -/// including additional `ThresholdKey` or `KeyList` descendants) may be -/// assigned as the sole entry in a file `keys` field to ensure all transactions -/// have the same signature requirements. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_FileServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateFileCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateFileCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteFileCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeAppendContentCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetFileContentCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetFileInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSystemDeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSystemUndeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.FileService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Service gRPC definitions for the Hedera File Service (HFS). + /// > + /// > #### Signature Requirements + /// > The HFS manages file authorization differently, depending on type of file + /// > transaction, and this can be surprising.
+ /// > The core element of file authorization is the `keys` field, + /// > which is a `KeyList`; a list of individual `Key` messages, each of which + /// > may represent a simple or complex key.
+ /// > The file service transactions treat this list differently.
+ /// > A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature + /// > from _each_ key in the list.
+ /// > A `fileDelete` MUST have a valid signature from _at least one_ key in + /// > the list. This is different, and allows a file "owned" by many entities + /// > to be deleted by any one of those entities. A deleted file cannot be + /// > restored, so it is important to consider this when assigning keys for + /// > a file.
+ /// > If any of the keys in a `KeyList` are complex, the full requirements of + /// > each complex key must be met to count as a "valid signature" for that key. + /// > A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly + /// > including additional `ThresholdKey` or `KeyList` descendants) may be + /// > assigned as the sole entry in a file `keys` field to ensure all transactions + /// > have the same signature requirements. + public protocol SimpleServiceProtocol: Proto_FileService.ServiceProtocol { + /// Handle the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createFile( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateFile( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteFile( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func appendContent( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getFileContent( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getFileInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func systemDelete( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func systemUndelete( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_FileServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_FileServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateFileCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.createFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateFileInterceptors() ?? [] - ) - } - - public func makeUpdateFileCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.updateFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateFileInterceptors() ?? [] - ) - } - - public func makeDeleteFileCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.deleteFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteFileInterceptors() ?? [] - ) - } - - public func makeAppendContentCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.appendContent.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeappendContentInterceptors() ?? [] - ) - } - - public func makeGetFileContentCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.getFileContent.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetFileContentInterceptors() ?? [] - ) - } - - public func makeGetFileInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.getFileInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetFileInfoInterceptors() ?? [] - ) - } - - public func makeSystemDeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.systemDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [] - ) - } - - public func makeSystemUndeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.systemUndelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_FileService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_FileService.Method.createFile.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createFile( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.updateFile.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateFile( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.deleteFile.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteFile( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.appendContent.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.appendContent( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.getFileContent.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getFileContent( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.getFileInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getFileInfo( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.systemDelete.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.systemDelete( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_FileService.Method.systemUndelete.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.systemUndelete( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_FileServiceAsyncClientProtocol { - public func createFile( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.createFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateFileInterceptors() ?? [] - ) - } - - public func updateFile( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.updateFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateFileInterceptors() ?? [] - ) - } - - public func deleteFile( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.deleteFile.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteFileInterceptors() ?? [] - ) - } - - public func appendContent( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.appendContent.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeappendContentInterceptors() ?? [] - ) - } - - public func getFileContent( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.getFileContent.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetFileContentInterceptors() ?? [] - ) - } - - public func getFileInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.getFileInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetFileInfoInterceptors() ?? [] - ) - } - - public func systemDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.systemDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [] - ) - } - - public func systemUndelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FileServiceClientMetadata.Methods.systemUndelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_FileService.ServiceProtocol { + public func createFile( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createFile( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_FileServiceAsyncClient: Proto_FileServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_FileServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func updateFile( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateFile( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_FileServiceClientInterceptorFactoryProtocol: Sendable { + public func deleteFile( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteFile( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'createFile'. - func makecreateFileInterceptors() -> [ClientInterceptor] + public func appendContent( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.appendContent( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'updateFile'. - func makeupdateFileInterceptors() -> [ClientInterceptor] + public func getFileContent( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getFileContent( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'deleteFile'. - func makedeleteFileInterceptors() -> [ClientInterceptor] + public func getFileInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getFileInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'appendContent'. - func makeappendContentInterceptors() -> [ClientInterceptor] + public func systemDelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.systemDelete( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'getFileContent'. - func makegetFileContentInterceptors() -> [ClientInterceptor] + public func systemUndelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.systemUndelete( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'getFileInfo'. - func makegetFileInfoInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_FileService.SimpleServiceProtocol { + public func createFile( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createFile( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'systemDelete'. - func makesystemDeleteInterceptors() -> [ClientInterceptor] + public func updateFile( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateFile( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'systemUndelete'. - func makesystemUndeleteInterceptors() -> [ClientInterceptor] -} + public func deleteFile( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteFile( + request: request.message, + context: context + ), + metadata: [:] + ) + } -public enum Proto_FileServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "FileService", - fullName: "proto.FileService", - methods: [ - Proto_FileServiceClientMetadata.Methods.createFile, - Proto_FileServiceClientMetadata.Methods.updateFile, - Proto_FileServiceClientMetadata.Methods.deleteFile, - Proto_FileServiceClientMetadata.Methods.appendContent, - Proto_FileServiceClientMetadata.Methods.getFileContent, - Proto_FileServiceClientMetadata.Methods.getFileInfo, - Proto_FileServiceClientMetadata.Methods.systemDelete, - Proto_FileServiceClientMetadata.Methods.systemUndelete, - ] - ) - - public enum Methods { - public static let createFile = GRPCMethodDescriptor( - name: "createFile", - path: "/proto.FileService/createFile", - type: GRPCCallType.unary - ) - - public static let updateFile = GRPCMethodDescriptor( - name: "updateFile", - path: "/proto.FileService/updateFile", - type: GRPCCallType.unary - ) - - public static let deleteFile = GRPCMethodDescriptor( - name: "deleteFile", - path: "/proto.FileService/deleteFile", - type: GRPCCallType.unary - ) - - public static let appendContent = GRPCMethodDescriptor( - name: "appendContent", - path: "/proto.FileService/appendContent", - type: GRPCCallType.unary - ) - - public static let getFileContent = GRPCMethodDescriptor( - name: "getFileContent", - path: "/proto.FileService/getFileContent", - type: GRPCCallType.unary - ) - - public static let getFileInfo = GRPCMethodDescriptor( - name: "getFileInfo", - path: "/proto.FileService/getFileInfo", - type: GRPCCallType.unary - ) - - public static let systemDelete = GRPCMethodDescriptor( - name: "systemDelete", - path: "/proto.FileService/systemDelete", - type: GRPCCallType.unary - ) - - public static let systemUndelete = GRPCMethodDescriptor( - name: "systemUndelete", - path: "/proto.FileService/systemUndelete", - type: GRPCCallType.unary - ) - } -} + public func appendContent( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.appendContent( + request: request.message, + context: context + ), + metadata: [:] + ) + } -///* -/// Service gRPC definitions for the Hedera File Service (HFS). -/// -/// #### Signature Requirements -/// The HFS manages file authorization differently, depending on type of file -/// transaction, and this can be surprising.
-/// The core element of file authorization is the `keys` field, -/// which is a `KeyList`; a list of individual `Key` messages, each of which -/// may represent a simple or complex key.
-/// The file service transactions treat this list differently.
-/// A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature -/// from _each_ key in the list.
-/// A `fileDelete` MUST have a valid signature from _at least one_ key in -/// the list. This is different, and allows a file "owned" by many entities -/// to be deleted by any one of those entities. A deleted file cannot be -/// restored, so it is important to consider this when assigning keys for -/// a file.
-/// If any of the keys in a `KeyList` are complex, the full requirements of -/// each complex key must be met to count as a "valid signature" for that key. -/// A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly -/// including additional `ThresholdKey` or `KeyList` descendants) may be -/// assigned as the sole entry in a file `keys` field to ensure all transactions -/// have the same signature requirements. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_FileServiceProvider: CallHandlerProvider { - var interceptors: Proto_FileServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a file in HFS. - func createFile(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Update a file in HFS. - func updateFile(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete a file in HFS.
- /// The content of a file deleted in this manner is completely removed - /// from network state, but the file metadata remains. - func deleteFile(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Append content to a file in HFS. - func appendContent(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the content of a file in HFS.
- /// Note that this query retrieves _only_ the file content, not any of - /// the metadata for the file. - func getFileContent(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the metadata for a file in HFS.
- /// Note that this query does not retrieve the file _content_. - func getFileInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete a "regular" file without "owner" authorization.
- /// This transaction _does not_ require signatures for the keys in - /// the file `keys` list, but must be signed by a "privileged" account. - ///

- /// This transaction SHALL NOT accept a file identifier for - /// a "system" file.
- /// This transaction SHALL NOT remove the _content_ of the file from state. - /// This permits use of the `systemUndelete` to reverse this action if - /// performed in error. - ///

- /// This is a privileged transaction, and only accounts 2-59 are permitted - /// to call this function, by default. The actual restriction is in the - /// `api-permission.properties` file in the consensus node configuration. - func systemDelete(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Undelete a "regular" file. - /// This transaction must be signed by a "privileged" account.
- ///

- /// This transaction SHALL NOT accept a file identifier for - /// a "system" file.
- /// The file identified SHOULD have been previously deleted.
- /// This transaction SHALL NOT recover the _content_ of a file unless that - /// file was deleted with a `systemDelete` transaction. The _content_ of a - /// file deleted with a `fileDelete` transaction is not retained in state. - ///

- /// This is a privileged transaction, and only accounts 2-60 are permitted - /// to call this function, by default. The actual restriction is in the - /// `api-permission.properties` file in the consensus node configuration. - func systemUndelete(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture -} + public func getFileContent( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getFileContent( + request: request.message, + context: context + ), + metadata: [:] + ) + } -extension Proto_FileServiceProvider { - public var serviceName: Substring { - return Proto_FileServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createFile": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateFileInterceptors() ?? [], - userFunction: self.createFile(request:context:) - ) - - case "updateFile": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateFileInterceptors() ?? [], - userFunction: self.updateFile(request:context:) - ) - - case "deleteFile": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteFileInterceptors() ?? [], - userFunction: self.deleteFile(request:context:) - ) - - case "appendContent": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeappendContentInterceptors() ?? [], - userFunction: self.appendContent(request:context:) - ) - - case "getFileContent": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetFileContentInterceptors() ?? [], - userFunction: self.getFileContent(request:context:) - ) - - case "getFileInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetFileInfoInterceptors() ?? [], - userFunction: self.getFileInfo(request:context:) - ) - - case "systemDelete": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [], - userFunction: self.systemDelete(request:context:) - ) - - case "systemUndelete": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [], - userFunction: self.systemUndelete(request:context:) - ) - - default: - return nil + public func getFileInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getFileInfo( + request: request.message, + context: context + ), + metadata: [:] + ) } - } -} -///* -/// Service gRPC definitions for the Hedera File Service (HFS). -/// -/// #### Signature Requirements -/// The HFS manages file authorization differently, depending on type of file -/// transaction, and this can be surprising.
-/// The core element of file authorization is the `keys` field, -/// which is a `KeyList`; a list of individual `Key` messages, each of which -/// may represent a simple or complex key.
-/// The file service transactions treat this list differently.
-/// A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature -/// from _each_ key in the list.
-/// A `fileDelete` MUST have a valid signature from _at least one_ key in -/// the list. This is different, and allows a file "owned" by many entities -/// to be deleted by any one of those entities. A deleted file cannot be -/// restored, so it is important to consider this when assigning keys for -/// a file.
-/// If any of the keys in a `KeyList` are complex, the full requirements of -/// each complex key must be met to count as a "valid signature" for that key. -/// A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly -/// including additional `ThresholdKey` or `KeyList` descendants) may be -/// assigned as the sole entry in a file `keys` field to ensure all transactions -/// have the same signature requirements. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_FileServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_FileServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a file in HFS. - func createFile( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Update a file in HFS. - func updateFile( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete a file in HFS.
- /// The content of a file deleted in this manner is completely removed - /// from network state, but the file metadata remains. - func deleteFile( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Append content to a file in HFS. - func appendContent( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Retrieve the content of a file in HFS.
- /// Note that this query retrieves _only_ the file content, not any of - /// the metadata for the file. - func getFileContent( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the metadata for a file in HFS.
- /// Note that this query does not retrieve the file _content_. - func getFileInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Delete a "regular" file without "owner" authorization.
- /// This transaction _does not_ require signatures for the keys in - /// the file `keys` list, but must be signed by a "privileged" account. - ///

- /// This transaction SHALL NOT accept a file identifier for - /// a "system" file.
- /// This transaction SHALL NOT remove the _content_ of the file from state. - /// This permits use of the `systemUndelete` to reverse this action if - /// performed in error. - ///

- /// This is a privileged transaction, and only accounts 2-59 are permitted - /// to call this function, by default. The actual restriction is in the - /// `api-permission.properties` file in the consensus node configuration. - func systemDelete( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Undelete a "regular" file. - /// This transaction must be signed by a "privileged" account.
- ///

- /// This transaction SHALL NOT accept a file identifier for - /// a "system" file.
- /// The file identified SHOULD have been previously deleted.
- /// This transaction SHALL NOT recover the _content_ of a file unless that - /// file was deleted with a `systemDelete` transaction. The _content_ of a - /// file deleted with a `fileDelete` transaction is not retained in state. - ///

- /// This is a privileged transaction, and only accounts 2-60 are permitted - /// to call this function, by default. The actual restriction is in the - /// `api-permission.properties` file in the consensus node configuration. - func systemUndelete( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse -} + public func systemDelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.systemDelete( + request: request.message, + context: context + ), + metadata: [:] + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_FileServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_FileServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_FileServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_FileServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createFile": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateFileInterceptors() ?? [], - wrapping: { try await self.createFile(request: $0, context: $1) } - ) - - case "updateFile": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateFileInterceptors() ?? [], - wrapping: { try await self.updateFile(request: $0, context: $1) } - ) - - case "deleteFile": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteFileInterceptors() ?? [], - wrapping: { try await self.deleteFile(request: $0, context: $1) } - ) - - case "appendContent": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeappendContentInterceptors() ?? [], - wrapping: { try await self.appendContent(request: $0, context: $1) } - ) - - case "getFileContent": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetFileContentInterceptors() ?? [], - wrapping: { try await self.getFileContent(request: $0, context: $1) } - ) - - case "getFileInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetFileInfoInterceptors() ?? [], - wrapping: { try await self.getFileInfo(request: $0, context: $1) } - ) - - case "systemDelete": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [], - wrapping: { try await self.systemDelete(request: $0, context: $1) } - ) - - case "systemUndelete": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [], - wrapping: { try await self.systemUndelete(request: $0, context: $1) } - ) - - default: - return nil + public func systemUndelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.systemUndelete( + request: request.message, + context: context + ), + metadata: [:] + ) } - } } -public protocol Proto_FileServiceServerInterceptorFactoryProtocol: Sendable { +// MARK: proto.FileService (client) + +extension Proto_FileService { + /// Generated client protocol for the "proto.FileService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Service gRPC definitions for the Hedera File Service (HFS). + /// > + /// > #### Signature Requirements + /// > The HFS manages file authorization differently, depending on type of file + /// > transaction, and this can be surprising.
+ /// > The core element of file authorization is the `keys` field, + /// > which is a `KeyList`; a list of individual `Key` messages, each of which + /// > may represent a simple or complex key.
+ /// > The file service transactions treat this list differently.
+ /// > A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature + /// > from _each_ key in the list.
+ /// > A `fileDelete` MUST have a valid signature from _at least one_ key in + /// > the list. This is different, and allows a file "owned" by many entities + /// > to be deleted by any one of those entities. A deleted file cannot be + /// > restored, so it is important to consider this when assigning keys for + /// > a file.
+ /// > If any of the keys in a `KeyList` are complex, the full requirements of + /// > each complex key must be met to count as a "valid signature" for that key. + /// > A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly + /// > including additional `ThresholdKey` or `KeyList` descendants) may be + /// > assigned as the sole entry in a file `keys` field to ensure all transactions + /// > have the same signature requirements. + public protocol ClientProtocol: Sendable { + /// Call the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createFile( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateFile( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteFile( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func appendContent( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getFileContent( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getFileInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func systemDelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func systemUndelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } - /// - Returns: Interceptors to use when handling 'createFile'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateFileInterceptors() -> [ServerInterceptor] + /// Generated client for the "proto.FileService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Service gRPC definitions for the Hedera File Service (HFS). + /// > + /// > #### Signature Requirements + /// > The HFS manages file authorization differently, depending on type of file + /// > transaction, and this can be surprising.
+ /// > The core element of file authorization is the `keys` field, + /// > which is a `KeyList`; a list of individual `Key` messages, each of which + /// > may represent a simple or complex key.
+ /// > The file service transactions treat this list differently.
+ /// > A `fileCreate`, `fileAppend`, or `fileUpdate` MUST have a valid signature + /// > from _each_ key in the list.
+ /// > A `fileDelete` MUST have a valid signature from _at least one_ key in + /// > the list. This is different, and allows a file "owned" by many entities + /// > to be deleted by any one of those entities. A deleted file cannot be + /// > restored, so it is important to consider this when assigning keys for + /// > a file.
+ /// > If any of the keys in a `KeyList` are complex, the full requirements of + /// > each complex key must be met to count as a "valid signature" for that key. + /// > A complex key structure (i.e. a `ThresholdKey`, or `KeyList`, possibly + /// > including additional `ThresholdKey` or `KeyList` descendants) may be + /// > assigned as the sole entry in a file `keys` field to ensure all transactions + /// > have the same signature requirements. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createFile( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.createFile.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateFile( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.updateFile.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteFile( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.deleteFile.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func appendContent( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.appendContent.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getFileContent( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.getFileContent.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getFileInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.getFileInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemDelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.systemDelete.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemUndelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FileService.Method.systemUndelete.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + } +} - /// - Returns: Interceptors to use when handling 'updateFile'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateFileInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_FileService.ClientProtocol { + /// Call the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createFile( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createFile( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteFile'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteFileInterceptors() -> [ServerInterceptor] + /// Call the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateFile( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateFile( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'appendContent'. - /// Defaults to calling `self.makeInterceptors()`. - func makeappendContentInterceptors() -> [ServerInterceptor] + /// Call the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteFile( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteFile( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getFileContent'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetFileContentInterceptors() -> [ServerInterceptor] + /// Call the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func appendContent( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.appendContent( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getFileInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetFileInfoInterceptors() -> [ServerInterceptor] + /// Call the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getFileContent( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getFileContent( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'systemDelete'. - /// Defaults to calling `self.makeInterceptors()`. - func makesystemDeleteInterceptors() -> [ServerInterceptor] + /// Call the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getFileInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getFileInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'systemUndelete'. - /// Defaults to calling `self.makeInterceptors()`. - func makesystemUndeleteInterceptors() -> [ServerInterceptor] -} + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemDelete( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.systemDelete( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -public enum Proto_FileServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "FileService", - fullName: "proto.FileService", - methods: [ - Proto_FileServiceServerMetadata.Methods.createFile, - Proto_FileServiceServerMetadata.Methods.updateFile, - Proto_FileServiceServerMetadata.Methods.deleteFile, - Proto_FileServiceServerMetadata.Methods.appendContent, - Proto_FileServiceServerMetadata.Methods.getFileContent, - Proto_FileServiceServerMetadata.Methods.getFileInfo, - Proto_FileServiceServerMetadata.Methods.systemDelete, - Proto_FileServiceServerMetadata.Methods.systemUndelete, - ] - ) - - public enum Methods { - public static let createFile = GRPCMethodDescriptor( - name: "createFile", - path: "/proto.FileService/createFile", - type: GRPCCallType.unary - ) - - public static let updateFile = GRPCMethodDescriptor( - name: "updateFile", - path: "/proto.FileService/updateFile", - type: GRPCCallType.unary - ) - - public static let deleteFile = GRPCMethodDescriptor( - name: "deleteFile", - path: "/proto.FileService/deleteFile", - type: GRPCCallType.unary - ) - - public static let appendContent = GRPCMethodDescriptor( - name: "appendContent", - path: "/proto.FileService/appendContent", - type: GRPCCallType.unary - ) - - public static let getFileContent = GRPCMethodDescriptor( - name: "getFileContent", - path: "/proto.FileService/getFileContent", - type: GRPCCallType.unary - ) - - public static let getFileInfo = GRPCMethodDescriptor( - name: "getFileInfo", - path: "/proto.FileService/getFileInfo", - type: GRPCCallType.unary - ) - - public static let systemDelete = GRPCMethodDescriptor( - name: "systemDelete", - path: "/proto.FileService/systemDelete", - type: GRPCCallType.unary - ) - - public static let systemUndelete = GRPCMethodDescriptor( - name: "systemUndelete", - path: "/proto.FileService/systemUndelete", - type: GRPCCallType.unary - ) - } + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemUndelete( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.systemUndelete( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } + +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_FileService.ClientProtocol { + /// Call the "createFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a file in HFS. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createFile( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createFile( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a file in HFS. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateFile( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateFile( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteFile" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a file in HFS.
+ /// > The content of a file deleted in this manner is completely removed + /// > from network state, but the file metadata remains. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteFile( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteFile( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "appendContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Append content to a file in HFS. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func appendContent( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.appendContent( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getFileContent" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the content of a file in HFS.
+ /// > Note that this query retrieves _only_ the file content, not any of + /// > the metadata for the file. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getFileContent( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getFileContent( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getFileInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a file in HFS.
+ /// > Note that this query does not retrieve the file _content_. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getFileInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getFileInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a "regular" file without "owner" authorization.
+ /// > This transaction _does not_ require signatures for the keys in + /// > the file `keys` list, but must be signed by a "privileged" account. + /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > This transaction SHALL NOT remove the _content_ of the file from state. + /// > This permits use of the `systemUndelete` to reverse this action if + /// > performed in error. + /// >

+ /// > This is a privileged transaction, and only accounts 2-59 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemDelete( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.systemDelete( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Undelete a "regular" file. + /// > This transaction must be signed by a "privileged" account.
+ /// >

+ /// > This transaction SHALL NOT accept a file identifier for + /// > a "system" file.
+ /// > The file identified SHOULD have been previously deleted.
+ /// > This transaction SHALL NOT recover the _content_ of a file unless that + /// > file was deleted with a `systemDelete` transaction. The _content_ of a + /// > file deleted with a `fileDelete` transaction is not retained in state. + /// >

+ /// > This is a privileged transaction, and only accounts 2-60 are permitted + /// > to call this function, by default. The actual restriction is in the + /// > `api-permission.properties` file in the consensus node configuration. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemUndelete( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.systemUndelete( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/file_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/file_update.grpc.swift new file mode 100644 index 00000000..f0b7c57f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/file_update.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # File Update +/// A message to modify the metadata for a file and/or _replace_ the contents. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/file_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/freeze.grpc.swift b/Sources/HieroProtobufs/Generated/services/freeze.grpc.swift new file mode 100644 index 00000000..27b7ece9 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/freeze.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Freeze +/// Transaction body for a network "freeze" transaction. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/freeze.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/freeze_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/freeze_service.grpc.swift index 8d7f4d69..fa9ee06c 100644 --- a/Sources/HieroProtobufs/Generated/services/freeze_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/freeze_service.grpc.swift @@ -1,351 +1,442 @@ -// +///* +/// # Freeze Service +/// A service to manage network freeze events. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/freeze_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// A service to manage network "freeze" events. -/// -/// This service provides a facility to prepare for network upgrades, halt network processing, -/// perform network software upgrades, and automatically restart the network following an upgrade. -/// -/// Usage: instantiate `Proto_FreezeServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_FreezeServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? { get } - - func freeze( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Proto_FreezeServiceClientProtocol { - public var serviceName: String { - return "proto.FreezeService" - } - - ///* - /// Freeze, cancel, or prepare a freeze. - /// This single transaction performs all of the functions supported - /// by the network freeze service. These functions include actions to - /// prepare an upgrade, prepare a telemetry upgrade, freeze the network, - /// freeze the network for upgrade, or abort a scheduled freeze. - ///

- /// The actual freeze action SHALL be determined by the `freeze_type` field - /// of the `FreezeTransactionBody`.
- /// The transaction body MUST be a `FreezeTransactionBody`. - /// - /// - Parameters: - /// - request: Request to send to freeze. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func freeze( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_FreezeServiceClientMetadata.Methods.freeze.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makefreezeInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Proto_FreezeServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_FreezeServiceNIOClient") -public final class Proto_FreezeServiceClient: Proto_FreezeServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.FreezeService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -public struct Proto_FreezeServiceNIOClient: Proto_FreezeServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.FreezeService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -///* -/// A service to manage network "freeze" events. -/// -/// This service provides a facility to prepare for network upgrades, halt network processing, -/// perform network software upgrades, and automatically restart the network following an upgrade. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_FreezeServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? { get } - - func makeFreezeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_FreezeServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_FreezeServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeFreezeCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_FreezeServiceClientMetadata.Methods.freeze.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makefreezeInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_FreezeServiceAsyncClientProtocol { - public func freeze( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_FreezeServiceClientMetadata.Methods.freeze.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makefreezeInterceptors() ?? [] - ) - } +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.FreezeService + +/// Namespace containing generated types for the "proto.FreezeService" service. +public enum Proto_FreezeService { + /// Service descriptor for the "proto.FreezeService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FreezeService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "freeze" metadata. + public enum freeze { + /// Request type for "freeze". + public typealias Input = Proto_Transaction + /// Response type for "freeze". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "freeze". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FreezeService"), + method: "freeze" + ) + } + /// Descriptors for all methods in the "proto.FreezeService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + freeze.descriptor + ] + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_FreezeServiceAsyncClient: Proto_FreezeServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_FreezeServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.FreezeService" service. + public static let proto_FreezeService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.FreezeService") } -public protocol Proto_FreezeServiceClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'freeze'. - func makefreezeInterceptors() -> [ClientInterceptor] -} +// MARK: proto.FreezeService (server) + +extension Proto_FreezeService { + /// Streaming variant of the service protocol for the "proto.FreezeService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A service to manage network "freeze" events. + /// > + /// > This service provides a facility to prepare for network upgrades, halt network processing, + /// > perform network software upgrades, and automatically restart the network following an upgrade. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func freeze( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public enum Proto_FreezeServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "FreezeService", - fullName: "proto.FreezeService", - methods: [ - Proto_FreezeServiceClientMetadata.Methods.freeze, - ] - ) + /// Service protocol for the "proto.FreezeService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A service to manage network "freeze" events. + /// > + /// > This service provides a facility to prepare for network upgrades, halt network processing, + /// > perform network software upgrades, and automatically restart the network following an upgrade. + public protocol ServiceProtocol: Proto_FreezeService.StreamingServiceProtocol { + /// Handle the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func freeze( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } - public enum Methods { - public static let freeze = GRPCMethodDescriptor( - name: "freeze", - path: "/proto.FreezeService/freeze", - type: GRPCCallType.unary - ) - } + /// Simple service protocol for the "proto.FreezeService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A service to manage network "freeze" events. + /// > + /// > This service provides a facility to prepare for network upgrades, halt network processing, + /// > perform network software upgrades, and automatically restart the network following an upgrade. + public protocol SimpleServiceProtocol: Proto_FreezeService.ServiceProtocol { + /// Handle the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func freeze( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -///* -/// A service to manage network "freeze" events. -/// -/// This service provides a facility to prepare for network upgrades, halt network processing, -/// perform network software upgrades, and automatically restart the network following an upgrade. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_FreezeServiceProvider: CallHandlerProvider { - var interceptors: Proto_FreezeServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Freeze, cancel, or prepare a freeze. - /// This single transaction performs all of the functions supported - /// by the network freeze service. These functions include actions to - /// prepare an upgrade, prepare a telemetry upgrade, freeze the network, - /// freeze the network for upgrade, or abort a scheduled freeze. - ///

- /// The actual freeze action SHALL be determined by the `freeze_type` field - /// of the `FreezeTransactionBody`.
- /// The transaction body MUST be a `FreezeTransactionBody`. - func freeze(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture +// Default implementation of 'registerMethods(with:)'. +extension Proto_FreezeService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_FreezeService.Method.freeze.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.freeze( + request: request, + context: context + ) + } + ) + } } -extension Proto_FreezeServiceProvider { - public var serviceName: Substring { - return Proto_FreezeServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "freeze": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makefreezeInterceptors() ?? [], - userFunction: self.freeze(request:context:) - ) - - default: - return nil +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_FreezeService.ServiceProtocol { + public func freeze( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.freeze( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) } - } } -///* -/// A service to manage network "freeze" events. -/// -/// This service provides a facility to prepare for network upgrades, halt network processing, -/// perform network software upgrades, and automatically restart the network following an upgrade. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_FreezeServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_FreezeServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Freeze, cancel, or prepare a freeze. - /// This single transaction performs all of the functions supported - /// by the network freeze service. These functions include actions to - /// prepare an upgrade, prepare a telemetry upgrade, freeze the network, - /// freeze the network for upgrade, or abort a scheduled freeze. - ///

- /// The actual freeze action SHALL be determined by the `freeze_type` field - /// of the `FreezeTransactionBody`.
- /// The transaction body MUST be a `FreezeTransactionBody`. - func freeze( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_FreezeService.SimpleServiceProtocol { + public func freeze( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.freeze( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_FreezeServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_FreezeServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_FreezeServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_FreezeServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "freeze": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makefreezeInterceptors() ?? [], - wrapping: { try await self.freeze(request: $0, context: $1) } - ) +// MARK: proto.FreezeService (client) + +extension Proto_FreezeService { + /// Generated client protocol for the "proto.FreezeService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A service to manage network "freeze" events. + /// > + /// > This service provides a facility to prepare for network upgrades, halt network processing, + /// > perform network software upgrades, and automatically restart the network following an upgrade. + public protocol ClientProtocol: Sendable { + /// Call the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func freeze( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } - default: - return nil + /// Generated client for the "proto.FreezeService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A service to manage network "freeze" events. + /// > + /// > This service provides a facility to prepare for network upgrades, halt network processing, + /// > perform network software upgrades, and automatically restart the network following an upgrade. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func freeze( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_FreezeService.Method.freeze.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } } - } } -public protocol Proto_FreezeServiceServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'freeze'. - /// Defaults to calling `self.makeInterceptors()`. - func makefreezeInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_FreezeService.ClientProtocol { + /// Call the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func freeze( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.freeze( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } -public enum Proto_FreezeServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "FreezeService", - fullName: "proto.FreezeService", - methods: [ - Proto_FreezeServiceServerMetadata.Methods.freeze, - ] - ) - - public enum Methods { - public static let freeze = GRPCMethodDescriptor( - name: "freeze", - path: "/proto.FreezeService/freeze", - type: GRPCCallType.unary - ) - } -} +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_FreezeService.ClientProtocol { + /// Call the "freeze" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze, cancel, or prepare a freeze. + /// > This single transaction performs all of the functions supported + /// > by the network freeze service. These functions include actions to + /// > prepare an upgrade, prepare a telemetry upgrade, freeze the network, + /// > freeze the network for upgrade, or abort a scheduled freeze. + /// >

+ /// > The actual freeze action SHALL be determined by the `freeze_type` field + /// > of the `FreezeTransactionBody`.
+ /// > The transaction body MUST be a `FreezeTransactionBody`. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func freeze( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.freeze( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/freeze_type.grpc.swift b/Sources/HieroProtobufs/Generated/services/freeze_type.grpc.swift new file mode 100644 index 00000000..e08d180c --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/freeze_type.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Freeze Type +/// An enumeration to select the type of a network freeze. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/freeze_type.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/get_account_details.grpc.swift b/Sources/HieroProtobufs/Generated/services/get_account_details.grpc.swift new file mode 100644 index 00000000..b1ca18a7 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/get_account_details.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Account Details +/// A standard query to inspect the full detail of an account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/get_account_details.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/get_by_key.grpc.swift b/Sources/HieroProtobufs/Generated/services/get_by_key.grpc.swift new file mode 100644 index 00000000..f815ac26 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/get_by_key.grpc.swift @@ -0,0 +1,33 @@ +///* +/// # Get By Key +/// An obsolete query to obtain a list of entities that refer to +/// a given Key object.
+/// Returned entities may be accounts, files, smart contracts, and/or +/// live hash entries. +/// +/// > Important +/// >> This query is obsolete and not supported.
+/// >> Any query of this type that is submitted SHALL fail with a `PRE_CHECK` +/// >> result of `NOT_SUPPORTED`. +/// +/// > Implementation Note +/// >> This query is not defined for any service, and while it is implemented +/// >> in the "Network Admin" service, it may be unnecessary to do so. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/get_by_key.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/get_by_solidity_id.grpc.swift b/Sources/HieroProtobufs/Generated/services/get_by_solidity_id.grpc.swift new file mode 100644 index 00000000..2dd446b1 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/get_by_solidity_id.grpc.swift @@ -0,0 +1,27 @@ +///* +/// # Get By Solidity +/// A standard query to obtain account and contract identifiers for a smart +/// contract, given the Solidity identifier for that contract. +/// +/// > Important +/// >> This query is obsolete and not supported.
+/// >> Any query of this type that is submitted SHALL fail with a `PRE_CHECK` +/// >> result of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/get_by_solidity_id.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/network_get_execution_time.grpc.swift b/Sources/HieroProtobufs/Generated/services/network_get_execution_time.grpc.swift new file mode 100644 index 00000000..1fe8d696 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/network_get_execution_time.grpc.swift @@ -0,0 +1,28 @@ +///* +/// # Get Execution Time +/// Given a list of transaction identifiers, return the time required to +/// process each transaction, excluding pre-consensus processing, consensus, +/// and post-processing (e.g. record stream generation). +/// +/// > Important +/// >> This query is obsolete and not supported.
+/// >> Any query of this type that is submitted SHALL fail with a `PRE_CHECK` +/// >> result of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/network_get_execution_time.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/network_get_version_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/network_get_version_info.grpc.swift new file mode 100644 index 00000000..301287f8 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/network_get_version_info.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Version +/// Standard query for services and API message versions. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/network_get_version_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/network_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/network_service.grpc.swift index 4797a551..04410400 100644 --- a/Sources/HieroProtobufs/Generated/services/network_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/network_service.grpc.swift @@ -1,702 +1,1224 @@ -// +///* +/// # Network Service +/// This service offers some basic "network information" queries. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/network_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// Basic "network information" queries. -/// -/// This service supports queries for the active services and API versions, -/// and a query for account details. -/// -/// Usage: instantiate `Proto_NetworkServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_NetworkServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? { get } - - func getVersionInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getAccountDetails( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getExecutionTime( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func uncheckedSubmit( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.NetworkService + +/// Namespace containing generated types for the "proto.NetworkService" service. +public enum Proto_NetworkService { + /// Service descriptor for the "proto.NetworkService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.NetworkService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "getVersionInfo" metadata. + public enum getVersionInfo { + /// Request type for "getVersionInfo". + public typealias Input = Proto_Query + /// Response type for "getVersionInfo". + public typealias Output = Proto_Response + /// Descriptor for "getVersionInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.NetworkService"), + method: "getVersionInfo" + ) + } + /// Namespace for "getAccountDetails" metadata. + public enum getAccountDetails { + /// Request type for "getAccountDetails". + public typealias Input = Proto_Query + /// Response type for "getAccountDetails". + public typealias Output = Proto_Response + /// Descriptor for "getAccountDetails". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.NetworkService"), + method: "getAccountDetails" + ) + } + /// Namespace for "getExecutionTime" metadata. + public enum getExecutionTime { + /// Request type for "getExecutionTime". + public typealias Input = Proto_Query + /// Response type for "getExecutionTime". + public typealias Output = Proto_Response + /// Descriptor for "getExecutionTime". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.NetworkService"), + method: "getExecutionTime" + ) + } + /// Namespace for "uncheckedSubmit" metadata. + public enum uncheckedSubmit { + /// Request type for "uncheckedSubmit". + public typealias Input = Proto_Transaction + /// Response type for "uncheckedSubmit". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "uncheckedSubmit". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.NetworkService"), + method: "uncheckedSubmit" + ) + } + /// Descriptors for all methods in the "proto.NetworkService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + getVersionInfo.descriptor, + getAccountDetails.descriptor, + getExecutionTime.descriptor, + uncheckedSubmit.descriptor + ] + } } -extension Proto_NetworkServiceClientProtocol { - public var serviceName: String { - return "proto.NetworkService" - } - - ///* - /// Retrieve the active versions of Hedera Services and API messages. - /// - /// - Parameters: - /// - request: Request to send to getVersionInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getVersionInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getVersionInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetVersionInfoInterceptors() ?? [] - ) - } - - ///* - /// Request detail information about an account. - ///

- /// The returned information SHALL include balance and allowances.
- /// The returned information SHALL NOT include a list of account records. - /// - /// - Parameters: - /// - request: Request to send to getAccountDetails. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getAccountDetails( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getAccountDetails.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountDetailsInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the time, in nanoseconds, spent in direct processing for one or - /// more recent transactions. - ///

- /// For each transaction identifier provided, if that transaction is - /// sufficiently recent (that is, it is within the range of the - /// configuration value `stats.executionTimesToTrack`), the node SHALL - /// return the time, in nanoseconds, spent to directly process that - /// transaction (that is, excluding time to reach consensus).
- /// Note that because each node processes every transaction for the Hedera - /// network, this query MAY be sent to any node. - ///

- ///

Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`.
- /// - /// - Parameters: - /// - request: Request to send to getExecutionTime. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getExecutionTime( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getExecutionTime.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetExecutionTimeInterceptors() ?? [] - ) - } - - ///* - /// Submit a transaction that wraps another transaction which will - /// skip most validation. - ///

- ///

Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`. - ///
- /// - /// - Parameters: - /// - request: Request to send to uncheckedSubmit. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func uncheckedSubmit( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.uncheckedSubmit.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeuncheckedSubmitInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.NetworkService" service. + public static let proto_NetworkService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.NetworkService") } -@available(*, deprecated) -extension Proto_NetworkServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_NetworkServiceNIOClient") -public final class Proto_NetworkServiceClient: Proto_NetworkServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.NetworkService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.NetworkService (server) + +extension Proto_NetworkService { + /// Streaming variant of the service protocol for the "proto.NetworkService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Basic "network information" queries. + /// > + /// > This service supports queries for the active services and API versions, + /// > and a query for account details. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getVersionInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getAccountDetails( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getExecutionTime( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func uncheckedSubmit( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_NetworkServiceNIOClient: Proto_NetworkServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.NetworkService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.NetworkService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Basic "network information" queries. + /// > + /// > This service supports queries for the active services and API versions, + /// > and a query for account details. + public protocol ServiceProtocol: Proto_NetworkService.StreamingServiceProtocol { + /// Handle the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getVersionInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getAccountDetails( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getExecutionTime( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func uncheckedSubmit( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// Basic "network information" queries. -/// -/// This service supports queries for the active services and API versions, -/// and a query for account details. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_NetworkServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? { get } - - func makeGetVersionInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetAccountDetailsCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetExecutionTimeCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUncheckedSubmitCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.NetworkService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Basic "network information" queries. + /// > + /// > This service supports queries for the active services and API versions, + /// > and a query for account details. + public protocol SimpleServiceProtocol: Proto_NetworkService.ServiceProtocol { + /// Handle the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getVersionInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getAccountDetails( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getExecutionTime( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func uncheckedSubmit( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_NetworkServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_NetworkServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeGetVersionInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getVersionInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetVersionInfoInterceptors() ?? [] - ) - } - - public func makeGetAccountDetailsCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getAccountDetails.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountDetailsInterceptors() ?? [] - ) - } - - public func makeGetExecutionTimeCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getExecutionTime.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetExecutionTimeInterceptors() ?? [] - ) - } - - public func makeUncheckedSubmitCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.uncheckedSubmit.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeuncheckedSubmitInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_NetworkService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_NetworkService.Method.getVersionInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getVersionInfo( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_NetworkService.Method.getAccountDetails.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getAccountDetails( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_NetworkService.Method.getExecutionTime.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getExecutionTime( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_NetworkService.Method.uncheckedSubmit.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.uncheckedSubmit( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_NetworkServiceAsyncClientProtocol { - public func getVersionInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getVersionInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetVersionInfoInterceptors() ?? [] - ) - } - - public func getAccountDetails( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getAccountDetails.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetAccountDetailsInterceptors() ?? [] - ) - } - - public func getExecutionTime( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.getExecutionTime.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetExecutionTimeInterceptors() ?? [] - ) - } - - public func uncheckedSubmit( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_NetworkServiceClientMetadata.Methods.uncheckedSubmit.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeuncheckedSubmitInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_NetworkService.ServiceProtocol { + public func getVersionInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getVersionInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_NetworkServiceAsyncClient: Proto_NetworkServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_NetworkServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func getAccountDetails( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getAccountDetails( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_NetworkServiceClientInterceptorFactoryProtocol: Sendable { + public func getExecutionTime( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getExecutionTime( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'getVersionInfo'. - func makegetVersionInfoInterceptors() -> [ClientInterceptor] + public func uncheckedSubmit( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.uncheckedSubmit( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'getAccountDetails'. - func makegetAccountDetailsInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_NetworkService.SimpleServiceProtocol { + public func getVersionInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getVersionInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getExecutionTime'. - func makegetExecutionTimeInterceptors() -> [ClientInterceptor] + public func getAccountDetails( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getAccountDetails( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'uncheckedSubmit'. - func makeuncheckedSubmitInterceptors() -> [ClientInterceptor] -} + public func getExecutionTime( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getExecutionTime( + request: request.message, + context: context + ), + metadata: [:] + ) + } -public enum Proto_NetworkServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "NetworkService", - fullName: "proto.NetworkService", - methods: [ - Proto_NetworkServiceClientMetadata.Methods.getVersionInfo, - Proto_NetworkServiceClientMetadata.Methods.getAccountDetails, - Proto_NetworkServiceClientMetadata.Methods.getExecutionTime, - Proto_NetworkServiceClientMetadata.Methods.uncheckedSubmit, - ] - ) - - public enum Methods { - public static let getVersionInfo = GRPCMethodDescriptor( - name: "getVersionInfo", - path: "/proto.NetworkService/getVersionInfo", - type: GRPCCallType.unary - ) - - public static let getAccountDetails = GRPCMethodDescriptor( - name: "getAccountDetails", - path: "/proto.NetworkService/getAccountDetails", - type: GRPCCallType.unary - ) - - public static let getExecutionTime = GRPCMethodDescriptor( - name: "getExecutionTime", - path: "/proto.NetworkService/getExecutionTime", - type: GRPCCallType.unary - ) - - public static let uncheckedSubmit = GRPCMethodDescriptor( - name: "uncheckedSubmit", - path: "/proto.NetworkService/uncheckedSubmit", - type: GRPCCallType.unary - ) - } + public func uncheckedSubmit( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.uncheckedSubmit( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -///* -/// Basic "network information" queries. -/// -/// This service supports queries for the active services and API versions, -/// and a query for account details. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_NetworkServiceProvider: CallHandlerProvider { - var interceptors: Proto_NetworkServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Retrieve the active versions of Hedera Services and API messages. - func getVersionInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Request detail information about an account. - ///

- /// The returned information SHALL include balance and allowances.
- /// The returned information SHALL NOT include a list of account records. - func getAccountDetails(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the time, in nanoseconds, spent in direct processing for one or - /// more recent transactions. - ///

- /// For each transaction identifier provided, if that transaction is - /// sufficiently recent (that is, it is within the range of the - /// configuration value `stats.executionTimesToTrack`), the node SHALL - /// return the time, in nanoseconds, spent to directly process that - /// transaction (that is, excluding time to reach consensus).
- /// Note that because each node processes every transaction for the Hedera - /// network, this query MAY be sent to any node. - ///

- ///

Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`.
- func getExecutionTime(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Submit a transaction that wraps another transaction which will - /// skip most validation. - ///

- ///

Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`. - ///
- func uncheckedSubmit(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture -} +// MARK: proto.NetworkService (client) + +extension Proto_NetworkService { + /// Generated client protocol for the "proto.NetworkService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Basic "network information" queries. + /// > + /// > This service supports queries for the active services and API versions, + /// > and a query for account details. + public protocol ClientProtocol: Sendable { + /// Call the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getVersionInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getAccountDetails( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getExecutionTime( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func uncheckedSubmit( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } -extension Proto_NetworkServiceProvider { - public var serviceName: Substring { - return Proto_NetworkServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "getVersionInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetVersionInfoInterceptors() ?? [], - userFunction: self.getVersionInfo(request:context:) - ) - - case "getAccountDetails": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetAccountDetailsInterceptors() ?? [], - userFunction: self.getAccountDetails(request:context:) - ) - - case "getExecutionTime": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetExecutionTimeInterceptors() ?? [], - userFunction: self.getExecutionTime(request:context:) - ) - - case "uncheckedSubmit": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeuncheckedSubmitInterceptors() ?? [], - userFunction: self.uncheckedSubmit(request:context:) - ) - - default: - return nil + /// Generated client for the "proto.NetworkService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Basic "network information" queries. + /// > + /// > This service supports queries for the active services and API versions, + /// > and a query for account details. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getVersionInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_NetworkService.Method.getVersionInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountDetails( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_NetworkService.Method.getAccountDetails.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getExecutionTime( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_NetworkService.Method.getExecutionTime.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func uncheckedSubmit( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_NetworkService.Method.uncheckedSubmit.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } } - } } -///* -/// Basic "network information" queries. -/// -/// This service supports queries for the active services and API versions, -/// and a query for account details. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_NetworkServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_NetworkServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Retrieve the active versions of Hedera Services and API messages. - func getVersionInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Request detail information about an account. - ///

- /// The returned information SHALL include balance and allowances.
- /// The returned information SHALL NOT include a list of account records. - func getAccountDetails( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the time, in nanoseconds, spent in direct processing for one or - /// more recent transactions. - ///

- /// For each transaction identifier provided, if that transaction is - /// sufficiently recent (that is, it is within the range of the - /// configuration value `stats.executionTimesToTrack`), the node SHALL - /// return the time, in nanoseconds, spent to directly process that - /// transaction (that is, excluding time to reach consensus).
- /// Note that because each node processes every transaction for the Hedera - /// network, this query MAY be sent to any node. - ///

- ///

Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`.
- func getExecutionTime( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Submit a transaction that wraps another transaction which will - /// skip most validation. - ///

- ///

Important
- /// This query is obsolete, not supported, and SHALL fail with a pre-check - /// result of `NOT_SUPPORTED`. - ///
- func uncheckedSubmit( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse -} +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_NetworkService.ClientProtocol { + /// Call the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getVersionInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getVersionInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_NetworkServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_NetworkServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_NetworkServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_NetworkServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "getVersionInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetVersionInfoInterceptors() ?? [], - wrapping: { try await self.getVersionInfo(request: $0, context: $1) } - ) - - case "getAccountDetails": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetAccountDetailsInterceptors() ?? [], - wrapping: { try await self.getAccountDetails(request: $0, context: $1) } - ) - - case "getExecutionTime": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetExecutionTimeInterceptors() ?? [], - wrapping: { try await self.getExecutionTime(request: $0, context: $1) } - ) - - case "uncheckedSubmit": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeuncheckedSubmitInterceptors() ?? [], - wrapping: { try await self.uncheckedSubmit(request: $0, context: $1) } - ) - - default: - return nil + /// Call the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountDetails( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getAccountDetails( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) } - } -} -public protocol Proto_NetworkServiceServerInterceptorFactoryProtocol: Sendable { + /// Call the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getExecutionTime( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getExecutionTime( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getVersionInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetVersionInfoInterceptors() -> [ServerInterceptor] + /// Call the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func uncheckedSubmit( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.uncheckedSubmit( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } +} - /// - Returns: Interceptors to use when handling 'getAccountDetails'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetAccountDetailsInterceptors() -> [ServerInterceptor] +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_NetworkService.ClientProtocol { + /// Call the "getVersionInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the active versions of Hedera Services and API messages. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getVersionInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getVersionInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getExecutionTime'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetExecutionTimeInterceptors() -> [ServerInterceptor] + /// Call the "getAccountDetails" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Request detail information about an account. + /// >

+ /// > The returned information SHALL include balance and allowances.
+ /// > The returned information SHALL NOT include a list of account records. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getAccountDetails( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getAccountDetails( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'uncheckedSubmit'. - /// Defaults to calling `self.makeInterceptors()`. - func makeuncheckedSubmitInterceptors() -> [ServerInterceptor] -} + /// Call the "getExecutionTime" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the time, in nanoseconds, spent in direct processing for one or + /// > more recent transactions. + /// >

+ /// > For each transaction identifier provided, if that transaction is + /// > sufficiently recent (that is, it is within the range of the + /// > configuration value `stats.executionTimesToTrack`), the node SHALL + /// > return the time, in nanoseconds, spent to directly process that + /// > transaction (that is, excluding time to reach consensus).
+ /// > Note that because each node processes every transaction for the Hedera + /// > network, this query MAY be sent to any node. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getExecutionTime( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getExecutionTime( + request: request, + options: options, + onResponse: handleResponse + ) + } -public enum Proto_NetworkServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "NetworkService", - fullName: "proto.NetworkService", - methods: [ - Proto_NetworkServiceServerMetadata.Methods.getVersionInfo, - Proto_NetworkServiceServerMetadata.Methods.getAccountDetails, - Proto_NetworkServiceServerMetadata.Methods.getExecutionTime, - Proto_NetworkServiceServerMetadata.Methods.uncheckedSubmit, - ] - ) - - public enum Methods { - public static let getVersionInfo = GRPCMethodDescriptor( - name: "getVersionInfo", - path: "/proto.NetworkService/getVersionInfo", - type: GRPCCallType.unary - ) - - public static let getAccountDetails = GRPCMethodDescriptor( - name: "getAccountDetails", - path: "/proto.NetworkService/getAccountDetails", - type: GRPCCallType.unary - ) - - public static let getExecutionTime = GRPCMethodDescriptor( - name: "getExecutionTime", - path: "/proto.NetworkService/getExecutionTime", - type: GRPCCallType.unary - ) - - public static let uncheckedSubmit = GRPCMethodDescriptor( - name: "uncheckedSubmit", - path: "/proto.NetworkService/uncheckedSubmit", - type: GRPCCallType.unary - ) - } -} + /// Call the "uncheckedSubmit" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Submit a transaction that wraps another transaction which will + /// > skip most validation. + /// >

+ /// >

Important
+ /// > This query is obsolete, not supported, and SHALL fail with a pre-check + /// > result of `NOT_SUPPORTED`. + /// >
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func uncheckedSubmit( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.uncheckedSubmit( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/node_create.grpc.swift b/Sources/HieroProtobufs/Generated/services/node_create.grpc.swift new file mode 100644 index 00000000..51ba6233 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/node_create.grpc.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/node_create.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/node_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/node_delete.grpc.swift new file mode 100644 index 00000000..05a5e361 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/node_delete.grpc.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/node_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/node_stake_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/node_stake_update.grpc.swift new file mode 100644 index 00000000..bb200f1f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/node_stake_update.grpc.swift @@ -0,0 +1,33 @@ +///* +/// # Node Stake Updates +/// A system-initiated (i.e. internal) transaction to update stake information +/// for nodes at the end of a staking period. +/// +/// Note that staking rewards are not paid immediately. The rewards are +/// calculated, and the amount to be paid is reserved in the reward account, +/// at the end of each staking period. The actual recipient accounts are then +/// paid rewards when that account participates in any transaction that +/// changes staking information or the account balance. This reduces the +/// resources for calculating the staking rewards, quite dramatically, +/// and provides an incentive for account owners to engage with the network, +/// in at least a minor fashion, occasionally (typically annually).
+/// The unexpected change in balances, however, can be surprising to the +/// account holder. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/node_stake_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/node_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/node_update.grpc.swift new file mode 100644 index 00000000..dbd87361 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/node_update.grpc.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/node_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/query.grpc.swift b/Sources/HieroProtobufs/Generated/services/query.grpc.swift new file mode 100644 index 00000000..26ca9b48 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/query.grpc.swift @@ -0,0 +1,25 @@ +///* +/// # Query +/// This is the parent message for all queries, and this message is +/// serialized and signed, with the signature included in the QueryHeader. +/// +/// All of the entries in the `query` `oneof` are fully specified elsewhere; +/// we only include a short summary here. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/query.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/query_header.grpc.swift b/Sources/HieroProtobufs/Generated/services/query_header.grpc.swift new file mode 100644 index 00000000..5d3ae38a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/query_header.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Query Header +/// Messages that comprise a header sent with each query request. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/query_header.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/response.grpc.swift b/Sources/HieroProtobufs/Generated/services/response.grpc.swift new file mode 100644 index 00000000..675e3168 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/response.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Query Response +/// The `Response` message is returned from a query transaction. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/response.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/response_code.grpc.swift b/Sources/HieroProtobufs/Generated/services/response_code.grpc.swift new file mode 100644 index 00000000..1f02534c --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/response_code.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/response_code.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/response_header.grpc.swift b/Sources/HieroProtobufs/Generated/services/response_header.grpc.swift new file mode 100644 index 00000000..fa6f463a --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/response_header.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Response Header +/// A standard header for all query responses. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/response_header.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/schedulable_transaction_body.grpc.swift b/Sources/HieroProtobufs/Generated/services/schedulable_transaction_body.grpc.swift new file mode 100644 index 00000000..0beaabd7 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/schedulable_transaction_body.grpc.swift @@ -0,0 +1,23 @@ +///* +/// # Schedulable Transaction Body +/// A message that replicates the `TransactionBody` message, with slight +/// changes to exclude fields that cannot be scheduled via a `scheduleCreate` +/// transaction. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/schedulable_transaction_body.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/schedule_create.grpc.swift b/Sources/HieroProtobufs/Generated/services/schedule_create.grpc.swift new file mode 100644 index 00000000..ac861e68 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/schedule_create.grpc.swift @@ -0,0 +1,25 @@ +///* +/// # Schedule Create +/// Message to create a schedule, which is an instruction to execute some other +/// transaction (the scheduled transaction) at a future time, either when +/// enough signatures are gathered (short term) or when the schedule expires +/// (long term). In all cases the scheduled transaction is not executed if +/// signature requirements are not met before the schedule expires. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/schedule_create.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/schedule_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/schedule_delete.grpc.swift new file mode 100644 index 00000000..ac0ae108 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/schedule_delete.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Schedule Delete +/// A transaction body for a `scheduleDelete` transaction. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/schedule_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/schedule_get_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/schedule_get_info.grpc.swift new file mode 100644 index 00000000..e1ae889e --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/schedule_get_info.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Schedule Get Information +/// Query body and response to retrieve information about a scheduled +/// transaction. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/schedule_get_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/schedule_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/schedule_service.grpc.swift index fd76513a..e7b3d37d 100644 --- a/Sources/HieroProtobufs/Generated/services/schedule_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/schedule_service.grpc.swift @@ -1,838 +1,1355 @@ -// +///* +/// # Schedule Service +/// gRPC service definitions for the Schedule Service. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/schedule_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// Transactions and queries for the Schedule Service.
-/// The Schedule Service enables transactions to be submitted without all -/// required signatures and offers a `scheduleSign` transaction to provide -/// additional signatures independently after the schedule is created. The -/// scheduled transaction may be executed immediately when all required -/// signatures are present, or at expiration if "long term" schedules -/// are enabled in network configuration. -/// -/// ### Execution -/// Scheduled transactions SHALL be executed under the following conditions. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is set for -/// that schedule then the transaction SHALL NOT be executed before the -/// network consensus time matches or exceeds the `expiration_time` field -/// for that schedule. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set -/// for that schedule, then the transaction SHALL be executed when all -/// signatures required by the scheduled transaction are active for that -/// schedule. This MAY be immediately after the `scheduleCreate` or a -/// subsequent `scheduleSign` transaction, or MAY be at expiration if -/// the signature requirements are met at that time. -/// 1. If "long term" schedules are _disabled_, then the scheduled transaction -/// SHALL be executed immediately after all signature requirements for the -/// scheduled transaction are met during the `scheduleCreate` or a subsequent -/// `scheduleSign` transaction. The scheduled transaction SHALL NOT be -/// on expiration when "long term" schedules are disabled. -/// -/// A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` -/// transaction after execution, until the schedule expires.
-/// When network consensus time matches or exceeds the `expiration_time` for -/// a schedule, that schedule SHALL be removed from state, whether it has -/// executed or not.
-/// If "long term" schedules are _disabled_, the maximum expiration time SHALL -/// be the consensus time of the `scheduleCreate` transaction extended by -/// the network configuration value `ledger.scheduleTxExpiryTimeSecs`. -/// -/// ### Block Stream Effects -/// When a scheduled transaction is executed, the timestamp in the transaction -/// identifier for that transaction SHALL be 1 nanosecond after the consensus -/// timestamp for the transaction that resulted in its execution. If execution -/// occurred at expiration, that transaction may be almost any transaction, -/// including another scheduled transaction that executed at expiration.
-/// The transaction identifier for a scheduled transaction that is executed -/// SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and -/// `transactionValidStart` values from the `scheduleCreate` that created the -/// schedule.
-/// The `scheduleRef` property of the record for a scheduled transaction SHALL -/// be populated with the schedule identifier of the schedule that executed. -/// -/// Usage: instantiate `Proto_ScheduleServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_ScheduleServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? { get } - - func createSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func signSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func getScheduleInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.ScheduleService + +/// Namespace containing generated types for the "proto.ScheduleService" service. +public enum Proto_ScheduleService { + /// Service descriptor for the "proto.ScheduleService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ScheduleService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createSchedule" metadata. + public enum createSchedule { + /// Request type for "createSchedule". + public typealias Input = Proto_Transaction + /// Response type for "createSchedule". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createSchedule". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ScheduleService"), + method: "createSchedule" + ) + } + /// Namespace for "signSchedule" metadata. + public enum signSchedule { + /// Request type for "signSchedule". + public typealias Input = Proto_Transaction + /// Response type for "signSchedule". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "signSchedule". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ScheduleService"), + method: "signSchedule" + ) + } + /// Namespace for "deleteSchedule" metadata. + public enum deleteSchedule { + /// Request type for "deleteSchedule". + public typealias Input = Proto_Transaction + /// Response type for "deleteSchedule". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteSchedule". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ScheduleService"), + method: "deleteSchedule" + ) + } + /// Namespace for "getScheduleInfo" metadata. + public enum getScheduleInfo { + /// Request type for "getScheduleInfo". + public typealias Input = Proto_Query + /// Response type for "getScheduleInfo". + public typealias Output = Proto_Response + /// Descriptor for "getScheduleInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ScheduleService"), + method: "getScheduleInfo" + ) + } + /// Descriptors for all methods in the "proto.ScheduleService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createSchedule.descriptor, + signSchedule.descriptor, + deleteSchedule.descriptor, + getScheduleInfo.descriptor + ] + } } -extension Proto_ScheduleServiceClientProtocol { - public var serviceName: String { - return "proto.ScheduleService" - } - - ///* - /// Create a new Schedule. - ///

- /// If all signature requirements are met with this transaction, the - /// scheduled transaction MAY execute immediately. - /// - /// - Parameters: - /// - request: Request to send to createSchedule. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.createSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateScheduleInterceptors() ?? [] - ) - } - - ///* - /// Add signatures to an existing schedule. - ///

- /// Signatures on this transaction SHALL be added to the set of active - /// signatures on the schedule, and MAY result in execution of the - /// scheduled transaction if all signature requirements are met. - /// - /// - Parameters: - /// - request: Request to send to signSchedule. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func signSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.signSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesignScheduleInterceptors() ?? [] - ) - } - - ///* - /// Mark an existing schedule deleted. - ///

- /// Once deleted a schedule SHALL NOT be executed and any subsequent - /// `scheduleSign` transaction SHALL fail. - /// - /// - Parameters: - /// - request: Request to send to deleteSchedule. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.deleteSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteScheduleInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the metadata for a schedule. - /// - /// - Parameters: - /// - request: Request to send to getScheduleInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getScheduleInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.getScheduleInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetScheduleInfoInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.ScheduleService" service. + public static let proto_ScheduleService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.ScheduleService") } -@available(*, deprecated) -extension Proto_ScheduleServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_ScheduleServiceNIOClient") -public final class Proto_ScheduleServiceClient: Proto_ScheduleServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.ScheduleService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.ScheduleService (server) + +extension Proto_ScheduleService { + /// Streaming variant of the service protocol for the "proto.ScheduleService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Schedule Service.
+ /// > The Schedule Service enables transactions to be submitted without all + /// > required signatures and offers a `scheduleSign` transaction to provide + /// > additional signatures independently after the schedule is created. The + /// > scheduled transaction may be executed immediately when all required + /// > signatures are present, or at expiration if "long term" schedules + /// > are enabled in network configuration. + /// > + /// > ### Execution + /// > Scheduled transactions SHALL be executed under the following conditions. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is set for + /// > that schedule then the transaction SHALL NOT be executed before the + /// > network consensus time matches or exceeds the `expiration_time` field + /// > for that schedule. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set + /// > for that schedule, then the transaction SHALL be executed when all + /// > signatures required by the scheduled transaction are active for that + /// > schedule. This MAY be immediately after the `scheduleCreate` or a + /// > subsequent `scheduleSign` transaction, or MAY be at expiration if + /// > the signature requirements are met at that time. + /// > 1. If "long term" schedules are _disabled_, then the scheduled transaction + /// > SHALL be executed immediately after all signature requirements for the + /// > scheduled transaction are met during the `scheduleCreate` or a subsequent + /// > `scheduleSign` transaction. The scheduled transaction SHALL NOT be + /// > on expiration when "long term" schedules are disabled. + /// > + /// > A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` + /// > transaction after execution, until the schedule expires.
+ /// > When network consensus time matches or exceeds the `expiration_time` for + /// > a schedule, that schedule SHALL be removed from state, whether it has + /// > executed or not.
+ /// > If "long term" schedules are _disabled_, the maximum expiration time SHALL + /// > be the consensus time of the `scheduleCreate` transaction extended by + /// > the network configuration value `ledger.scheduleTxExpiryTimeSecs`. + /// > + /// > ### Block Stream Effects + /// > When a scheduled transaction is executed, the timestamp in the transaction + /// > identifier for that transaction SHALL be 1 nanosecond after the consensus + /// > timestamp for the transaction that resulted in its execution. If execution + /// > occurred at expiration, that transaction may be almost any transaction, + /// > including another scheduled transaction that executed at expiration.
+ /// > The transaction identifier for a scheduled transaction that is executed + /// > SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and + /// > `transactionValidStart` values from the `scheduleCreate` that created the + /// > schedule.
+ /// > The `scheduleRef` property of the record for a scheduled transaction SHALL + /// > be populated with the schedule identifier of the schedule that executed. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func signSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getScheduleInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_ScheduleServiceNIOClient: Proto_ScheduleServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.ScheduleService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.ScheduleService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Schedule Service.
+ /// > The Schedule Service enables transactions to be submitted without all + /// > required signatures and offers a `scheduleSign` transaction to provide + /// > additional signatures independently after the schedule is created. The + /// > scheduled transaction may be executed immediately when all required + /// > signatures are present, or at expiration if "long term" schedules + /// > are enabled in network configuration. + /// > + /// > ### Execution + /// > Scheduled transactions SHALL be executed under the following conditions. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is set for + /// > that schedule then the transaction SHALL NOT be executed before the + /// > network consensus time matches or exceeds the `expiration_time` field + /// > for that schedule. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set + /// > for that schedule, then the transaction SHALL be executed when all + /// > signatures required by the scheduled transaction are active for that + /// > schedule. This MAY be immediately after the `scheduleCreate` or a + /// > subsequent `scheduleSign` transaction, or MAY be at expiration if + /// > the signature requirements are met at that time. + /// > 1. If "long term" schedules are _disabled_, then the scheduled transaction + /// > SHALL be executed immediately after all signature requirements for the + /// > scheduled transaction are met during the `scheduleCreate` or a subsequent + /// > `scheduleSign` transaction. The scheduled transaction SHALL NOT be + /// > on expiration when "long term" schedules are disabled. + /// > + /// > A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` + /// > transaction after execution, until the schedule expires.
+ /// > When network consensus time matches or exceeds the `expiration_time` for + /// > a schedule, that schedule SHALL be removed from state, whether it has + /// > executed or not.
+ /// > If "long term" schedules are _disabled_, the maximum expiration time SHALL + /// > be the consensus time of the `scheduleCreate` transaction extended by + /// > the network configuration value `ledger.scheduleTxExpiryTimeSecs`. + /// > + /// > ### Block Stream Effects + /// > When a scheduled transaction is executed, the timestamp in the transaction + /// > identifier for that transaction SHALL be 1 nanosecond after the consensus + /// > timestamp for the transaction that resulted in its execution. If execution + /// > occurred at expiration, that transaction may be almost any transaction, + /// > including another scheduled transaction that executed at expiration.
+ /// > The transaction identifier for a scheduled transaction that is executed + /// > SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and + /// > `transactionValidStart` values from the `scheduleCreate` that created the + /// > schedule.
+ /// > The `scheduleRef` property of the record for a scheduled transaction SHALL + /// > be populated with the schedule identifier of the schedule that executed. + public protocol ServiceProtocol: Proto_ScheduleService.StreamingServiceProtocol { + /// Handle the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func signSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getScheduleInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// Transactions and queries for the Schedule Service.
-/// The Schedule Service enables transactions to be submitted without all -/// required signatures and offers a `scheduleSign` transaction to provide -/// additional signatures independently after the schedule is created. The -/// scheduled transaction may be executed immediately when all required -/// signatures are present, or at expiration if "long term" schedules -/// are enabled in network configuration. -/// -/// ### Execution -/// Scheduled transactions SHALL be executed under the following conditions. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is set for -/// that schedule then the transaction SHALL NOT be executed before the -/// network consensus time matches or exceeds the `expiration_time` field -/// for that schedule. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set -/// for that schedule, then the transaction SHALL be executed when all -/// signatures required by the scheduled transaction are active for that -/// schedule. This MAY be immediately after the `scheduleCreate` or a -/// subsequent `scheduleSign` transaction, or MAY be at expiration if -/// the signature requirements are met at that time. -/// 1. If "long term" schedules are _disabled_, then the scheduled transaction -/// SHALL be executed immediately after all signature requirements for the -/// scheduled transaction are met during the `scheduleCreate` or a subsequent -/// `scheduleSign` transaction. The scheduled transaction SHALL NOT be -/// on expiration when "long term" schedules are disabled. -/// -/// A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` -/// transaction after execution, until the schedule expires.
-/// When network consensus time matches or exceeds the `expiration_time` for -/// a schedule, that schedule SHALL be removed from state, whether it has -/// executed or not.
-/// If "long term" schedules are _disabled_, the maximum expiration time SHALL -/// be the consensus time of the `scheduleCreate` transaction extended by -/// the network configuration value `ledger.scheduleTxExpiryTimeSecs`. -/// -/// ### Block Stream Effects -/// When a scheduled transaction is executed, the timestamp in the transaction -/// identifier for that transaction SHALL be 1 nanosecond after the consensus -/// timestamp for the transaction that resulted in its execution. If execution -/// occurred at expiration, that transaction may be almost any transaction, -/// including another scheduled transaction that executed at expiration.
-/// The transaction identifier for a scheduled transaction that is executed -/// SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and -/// `transactionValidStart` values from the `scheduleCreate` that created the -/// schedule.
-/// The `scheduleRef` property of the record for a scheduled transaction SHALL -/// be populated with the schedule identifier of the schedule that executed. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_ScheduleServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSignScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetScheduleInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.ScheduleService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Schedule Service.
+ /// > The Schedule Service enables transactions to be submitted without all + /// > required signatures and offers a `scheduleSign` transaction to provide + /// > additional signatures independently after the schedule is created. The + /// > scheduled transaction may be executed immediately when all required + /// > signatures are present, or at expiration if "long term" schedules + /// > are enabled in network configuration. + /// > + /// > ### Execution + /// > Scheduled transactions SHALL be executed under the following conditions. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is set for + /// > that schedule then the transaction SHALL NOT be executed before the + /// > network consensus time matches or exceeds the `expiration_time` field + /// > for that schedule. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set + /// > for that schedule, then the transaction SHALL be executed when all + /// > signatures required by the scheduled transaction are active for that + /// > schedule. This MAY be immediately after the `scheduleCreate` or a + /// > subsequent `scheduleSign` transaction, or MAY be at expiration if + /// > the signature requirements are met at that time. + /// > 1. If "long term" schedules are _disabled_, then the scheduled transaction + /// > SHALL be executed immediately after all signature requirements for the + /// > scheduled transaction are met during the `scheduleCreate` or a subsequent + /// > `scheduleSign` transaction. The scheduled transaction SHALL NOT be + /// > on expiration when "long term" schedules are disabled. + /// > + /// > A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` + /// > transaction after execution, until the schedule expires.
+ /// > When network consensus time matches or exceeds the `expiration_time` for + /// > a schedule, that schedule SHALL be removed from state, whether it has + /// > executed or not.
+ /// > If "long term" schedules are _disabled_, the maximum expiration time SHALL + /// > be the consensus time of the `scheduleCreate` transaction extended by + /// > the network configuration value `ledger.scheduleTxExpiryTimeSecs`. + /// > + /// > ### Block Stream Effects + /// > When a scheduled transaction is executed, the timestamp in the transaction + /// > identifier for that transaction SHALL be 1 nanosecond after the consensus + /// > timestamp for the transaction that resulted in its execution. If execution + /// > occurred at expiration, that transaction may be almost any transaction, + /// > including another scheduled transaction that executed at expiration.
+ /// > The transaction identifier for a scheduled transaction that is executed + /// > SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and + /// > `transactionValidStart` values from the `scheduleCreate` that created the + /// > schedule.
+ /// > The `scheduleRef` property of the record for a scheduled transaction SHALL + /// > be populated with the schedule identifier of the schedule that executed. + public protocol SimpleServiceProtocol: Proto_ScheduleService.ServiceProtocol { + /// Handle the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createSchedule( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func signSchedule( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteSchedule( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getScheduleInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_ScheduleServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_ScheduleServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.createSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateScheduleInterceptors() ?? [] - ) - } - - public func makeSignScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.signSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesignScheduleInterceptors() ?? [] - ) - } - - public func makeDeleteScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.deleteSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteScheduleInterceptors() ?? [] - ) - } - - public func makeGetScheduleInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.getScheduleInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetScheduleInfoInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_ScheduleService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_ScheduleService.Method.createSchedule.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createSchedule( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ScheduleService.Method.signSchedule.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.signSchedule( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ScheduleService.Method.deleteSchedule.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteSchedule( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_ScheduleService.Method.getScheduleInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getScheduleInfo( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_ScheduleServiceAsyncClientProtocol { - public func createSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.createSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateScheduleInterceptors() ?? [] - ) - } - - public func signSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.signSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesignScheduleInterceptors() ?? [] - ) - } - - public func deleteSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.deleteSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteScheduleInterceptors() ?? [] - ) - } - - public func getScheduleInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_ScheduleServiceClientMetadata.Methods.getScheduleInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetScheduleInfoInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_ScheduleService.ServiceProtocol { + public func createSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createSchedule( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_ScheduleServiceAsyncClient: Proto_ScheduleServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_ScheduleServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func signSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.signSchedule( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_ScheduleServiceClientInterceptorFactoryProtocol: Sendable { + public func deleteSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteSchedule( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'createSchedule'. - func makecreateScheduleInterceptors() -> [ClientInterceptor] + public func getScheduleInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getScheduleInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'signSchedule'. - func makesignScheduleInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_ScheduleService.SimpleServiceProtocol { + public func createSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createSchedule( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'deleteSchedule'. - func makedeleteScheduleInterceptors() -> [ClientInterceptor] + public func signSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.signSchedule( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getScheduleInfo'. - func makegetScheduleInfoInterceptors() -> [ClientInterceptor] -} + public func deleteSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteSchedule( + request: request.message, + context: context + ), + metadata: [:] + ) + } -public enum Proto_ScheduleServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "ScheduleService", - fullName: "proto.ScheduleService", - methods: [ - Proto_ScheduleServiceClientMetadata.Methods.createSchedule, - Proto_ScheduleServiceClientMetadata.Methods.signSchedule, - Proto_ScheduleServiceClientMetadata.Methods.deleteSchedule, - Proto_ScheduleServiceClientMetadata.Methods.getScheduleInfo, - ] - ) - - public enum Methods { - public static let createSchedule = GRPCMethodDescriptor( - name: "createSchedule", - path: "/proto.ScheduleService/createSchedule", - type: GRPCCallType.unary - ) - - public static let signSchedule = GRPCMethodDescriptor( - name: "signSchedule", - path: "/proto.ScheduleService/signSchedule", - type: GRPCCallType.unary - ) - - public static let deleteSchedule = GRPCMethodDescriptor( - name: "deleteSchedule", - path: "/proto.ScheduleService/deleteSchedule", - type: GRPCCallType.unary - ) - - public static let getScheduleInfo = GRPCMethodDescriptor( - name: "getScheduleInfo", - path: "/proto.ScheduleService/getScheduleInfo", - type: GRPCCallType.unary - ) - } + public func getScheduleInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getScheduleInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -///* -/// Transactions and queries for the Schedule Service.
-/// The Schedule Service enables transactions to be submitted without all -/// required signatures and offers a `scheduleSign` transaction to provide -/// additional signatures independently after the schedule is created. The -/// scheduled transaction may be executed immediately when all required -/// signatures are present, or at expiration if "long term" schedules -/// are enabled in network configuration. -/// -/// ### Execution -/// Scheduled transactions SHALL be executed under the following conditions. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is set for -/// that schedule then the transaction SHALL NOT be executed before the -/// network consensus time matches or exceeds the `expiration_time` field -/// for that schedule. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set -/// for that schedule, then the transaction SHALL be executed when all -/// signatures required by the scheduled transaction are active for that -/// schedule. This MAY be immediately after the `scheduleCreate` or a -/// subsequent `scheduleSign` transaction, or MAY be at expiration if -/// the signature requirements are met at that time. -/// 1. If "long term" schedules are _disabled_, then the scheduled transaction -/// SHALL be executed immediately after all signature requirements for the -/// scheduled transaction are met during the `scheduleCreate` or a subsequent -/// `scheduleSign` transaction. The scheduled transaction SHALL NOT be -/// on expiration when "long term" schedules are disabled. -/// -/// A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` -/// transaction after execution, until the schedule expires.
-/// When network consensus time matches or exceeds the `expiration_time` for -/// a schedule, that schedule SHALL be removed from state, whether it has -/// executed or not.
-/// If "long term" schedules are _disabled_, the maximum expiration time SHALL -/// be the consensus time of the `scheduleCreate` transaction extended by -/// the network configuration value `ledger.scheduleTxExpiryTimeSecs`. -/// -/// ### Block Stream Effects -/// When a scheduled transaction is executed, the timestamp in the transaction -/// identifier for that transaction SHALL be 1 nanosecond after the consensus -/// timestamp for the transaction that resulted in its execution. If execution -/// occurred at expiration, that transaction may be almost any transaction, -/// including another scheduled transaction that executed at expiration.
-/// The transaction identifier for a scheduled transaction that is executed -/// SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and -/// `transactionValidStart` values from the `scheduleCreate` that created the -/// schedule.
-/// The `scheduleRef` property of the record for a scheduled transaction SHALL -/// be populated with the schedule identifier of the schedule that executed. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_ScheduleServiceProvider: CallHandlerProvider { - var interceptors: Proto_ScheduleServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new Schedule. - ///

- /// If all signature requirements are met with this transaction, the - /// scheduled transaction MAY execute immediately. - func createSchedule(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Add signatures to an existing schedule. - ///

- /// Signatures on this transaction SHALL be added to the set of active - /// signatures on the schedule, and MAY result in execution of the - /// scheduled transaction if all signature requirements are met. - func signSchedule(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Mark an existing schedule deleted. - ///

- /// Once deleted a schedule SHALL NOT be executed and any subsequent - /// `scheduleSign` transaction SHALL fail. - func deleteSchedule(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the metadata for a schedule. - func getScheduleInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture -} +// MARK: proto.ScheduleService (client) + +extension Proto_ScheduleService { + /// Generated client protocol for the "proto.ScheduleService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Schedule Service.
+ /// > The Schedule Service enables transactions to be submitted without all + /// > required signatures and offers a `scheduleSign` transaction to provide + /// > additional signatures independently after the schedule is created. The + /// > scheduled transaction may be executed immediately when all required + /// > signatures are present, or at expiration if "long term" schedules + /// > are enabled in network configuration. + /// > + /// > ### Execution + /// > Scheduled transactions SHALL be executed under the following conditions. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is set for + /// > that schedule then the transaction SHALL NOT be executed before the + /// > network consensus time matches or exceeds the `expiration_time` field + /// > for that schedule. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set + /// > for that schedule, then the transaction SHALL be executed when all + /// > signatures required by the scheduled transaction are active for that + /// > schedule. This MAY be immediately after the `scheduleCreate` or a + /// > subsequent `scheduleSign` transaction, or MAY be at expiration if + /// > the signature requirements are met at that time. + /// > 1. If "long term" schedules are _disabled_, then the scheduled transaction + /// > SHALL be executed immediately after all signature requirements for the + /// > scheduled transaction are met during the `scheduleCreate` or a subsequent + /// > `scheduleSign` transaction. The scheduled transaction SHALL NOT be + /// > on expiration when "long term" schedules are disabled. + /// > + /// > A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` + /// > transaction after execution, until the schedule expires.
+ /// > When network consensus time matches or exceeds the `expiration_time` for + /// > a schedule, that schedule SHALL be removed from state, whether it has + /// > executed or not.
+ /// > If "long term" schedules are _disabled_, the maximum expiration time SHALL + /// > be the consensus time of the `scheduleCreate` transaction extended by + /// > the network configuration value `ledger.scheduleTxExpiryTimeSecs`. + /// > + /// > ### Block Stream Effects + /// > When a scheduled transaction is executed, the timestamp in the transaction + /// > identifier for that transaction SHALL be 1 nanosecond after the consensus + /// > timestamp for the transaction that resulted in its execution. If execution + /// > occurred at expiration, that transaction may be almost any transaction, + /// > including another scheduled transaction that executed at expiration.
+ /// > The transaction identifier for a scheduled transaction that is executed + /// > SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and + /// > `transactionValidStart` values from the `scheduleCreate` that created the + /// > schedule.
+ /// > The `scheduleRef` property of the record for a scheduled transaction SHALL + /// > be populated with the schedule identifier of the schedule that executed. + public protocol ClientProtocol: Sendable { + /// Call the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func signSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getScheduleInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } -extension Proto_ScheduleServiceProvider { - public var serviceName: Substring { - return Proto_ScheduleServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createSchedule": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateScheduleInterceptors() ?? [], - userFunction: self.createSchedule(request:context:) - ) - - case "signSchedule": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesignScheduleInterceptors() ?? [], - userFunction: self.signSchedule(request:context:) - ) - - case "deleteSchedule": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteScheduleInterceptors() ?? [], - userFunction: self.deleteSchedule(request:context:) - ) - - case "getScheduleInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetScheduleInfoInterceptors() ?? [], - userFunction: self.getScheduleInfo(request:context:) - ) - - default: - return nil + /// Generated client for the "proto.ScheduleService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Schedule Service.
+ /// > The Schedule Service enables transactions to be submitted without all + /// > required signatures and offers a `scheduleSign` transaction to provide + /// > additional signatures independently after the schedule is created. The + /// > scheduled transaction may be executed immediately when all required + /// > signatures are present, or at expiration if "long term" schedules + /// > are enabled in network configuration. + /// > + /// > ### Execution + /// > Scheduled transactions SHALL be executed under the following conditions. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is set for + /// > that schedule then the transaction SHALL NOT be executed before the + /// > network consensus time matches or exceeds the `expiration_time` field + /// > for that schedule. + /// > 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set + /// > for that schedule, then the transaction SHALL be executed when all + /// > signatures required by the scheduled transaction are active for that + /// > schedule. This MAY be immediately after the `scheduleCreate` or a + /// > subsequent `scheduleSign` transaction, or MAY be at expiration if + /// > the signature requirements are met at that time. + /// > 1. If "long term" schedules are _disabled_, then the scheduled transaction + /// > SHALL be executed immediately after all signature requirements for the + /// > scheduled transaction are met during the `scheduleCreate` or a subsequent + /// > `scheduleSign` transaction. The scheduled transaction SHALL NOT be + /// > on expiration when "long term" schedules are disabled. + /// > + /// > A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` + /// > transaction after execution, until the schedule expires.
+ /// > When network consensus time matches or exceeds the `expiration_time` for + /// > a schedule, that schedule SHALL be removed from state, whether it has + /// > executed or not.
+ /// > If "long term" schedules are _disabled_, the maximum expiration time SHALL + /// > be the consensus time of the `scheduleCreate` transaction extended by + /// > the network configuration value `ledger.scheduleTxExpiryTimeSecs`. + /// > + /// > ### Block Stream Effects + /// > When a scheduled transaction is executed, the timestamp in the transaction + /// > identifier for that transaction SHALL be 1 nanosecond after the consensus + /// > timestamp for the transaction that resulted in its execution. If execution + /// > occurred at expiration, that transaction may be almost any transaction, + /// > including another scheduled transaction that executed at expiration.
+ /// > The transaction identifier for a scheduled transaction that is executed + /// > SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and + /// > `transactionValidStart` values from the `scheduleCreate` that created the + /// > schedule.
+ /// > The `scheduleRef` property of the record for a scheduled transaction SHALL + /// > be populated with the schedule identifier of the schedule that executed. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ScheduleService.Method.createSchedule.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func signSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ScheduleService.Method.signSchedule.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ScheduleService.Method.deleteSchedule.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getScheduleInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_ScheduleService.Method.getScheduleInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } } - } } -///* -/// Transactions and queries for the Schedule Service.
-/// The Schedule Service enables transactions to be submitted without all -/// required signatures and offers a `scheduleSign` transaction to provide -/// additional signatures independently after the schedule is created. The -/// scheduled transaction may be executed immediately when all required -/// signatures are present, or at expiration if "long term" schedules -/// are enabled in network configuration. -/// -/// ### Execution -/// Scheduled transactions SHALL be executed under the following conditions. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is set for -/// that schedule then the transaction SHALL NOT be executed before the -/// network consensus time matches or exceeds the `expiration_time` field -/// for that schedule. -/// 1. If "long term" schedules are enabled and `wait_for_expiry` is _not_ set -/// for that schedule, then the transaction SHALL be executed when all -/// signatures required by the scheduled transaction are active for that -/// schedule. This MAY be immediately after the `scheduleCreate` or a -/// subsequent `scheduleSign` transaction, or MAY be at expiration if -/// the signature requirements are met at that time. -/// 1. If "long term" schedules are _disabled_, then the scheduled transaction -/// SHALL be executed immediately after all signature requirements for the -/// scheduled transaction are met during the `scheduleCreate` or a subsequent -/// `scheduleSign` transaction. The scheduled transaction SHALL NOT be -/// on expiration when "long term" schedules are disabled. -/// -/// A schedule SHALL remain in state and MAY be queried with a `getScheduleInfo` -/// transaction after execution, until the schedule expires.
-/// When network consensus time matches or exceeds the `expiration_time` for -/// a schedule, that schedule SHALL be removed from state, whether it has -/// executed or not.
-/// If "long term" schedules are _disabled_, the maximum expiration time SHALL -/// be the consensus time of the `scheduleCreate` transaction extended by -/// the network configuration value `ledger.scheduleTxExpiryTimeSecs`. -/// -/// ### Block Stream Effects -/// When a scheduled transaction is executed, the timestamp in the transaction -/// identifier for that transaction SHALL be 1 nanosecond after the consensus -/// timestamp for the transaction that resulted in its execution. If execution -/// occurred at expiration, that transaction may be almost any transaction, -/// including another scheduled transaction that executed at expiration.
-/// The transaction identifier for a scheduled transaction that is executed -/// SHALL have the `scheduled` flag set and SHALL inherit the `accountID` and -/// `transactionValidStart` values from the `scheduleCreate` that created the -/// schedule.
-/// The `scheduleRef` property of the record for a scheduled transaction SHALL -/// be populated with the schedule identifier of the schedule that executed. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_ScheduleServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_ScheduleServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new Schedule. - ///

- /// If all signature requirements are met with this transaction, the - /// scheduled transaction MAY execute immediately. - func createSchedule( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Add signatures to an existing schedule. - ///

- /// Signatures on this transaction SHALL be added to the set of active - /// signatures on the schedule, and MAY result in execution of the - /// scheduled transaction if all signature requirements are met. - func signSchedule( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Mark an existing schedule deleted. - ///

- /// Once deleted a schedule SHALL NOT be executed and any subsequent - /// `scheduleSign` transaction SHALL fail. - func deleteSchedule( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Retrieve the metadata for a schedule. - func getScheduleInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response -} +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_ScheduleService.ClientProtocol { + /// Call the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createSchedule( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createSchedule( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_ScheduleServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_ScheduleServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_ScheduleServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_ScheduleServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createSchedule": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateScheduleInterceptors() ?? [], - wrapping: { try await self.createSchedule(request: $0, context: $1) } - ) - - case "signSchedule": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesignScheduleInterceptors() ?? [], - wrapping: { try await self.signSchedule(request: $0, context: $1) } - ) - - case "deleteSchedule": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteScheduleInterceptors() ?? [], - wrapping: { try await self.deleteSchedule(request: $0, context: $1) } - ) - - case "getScheduleInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetScheduleInfoInterceptors() ?? [], - wrapping: { try await self.getScheduleInfo(request: $0, context: $1) } - ) - - default: - return nil + /// Call the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func signSchedule( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.signSchedule( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) } - } -} -public protocol Proto_ScheduleServiceServerInterceptorFactoryProtocol: Sendable { + /// Call the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteSchedule( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteSchedule( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'createSchedule'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateScheduleInterceptors() -> [ServerInterceptor] + /// Call the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getScheduleInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getScheduleInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } +} - /// - Returns: Interceptors to use when handling 'signSchedule'. - /// Defaults to calling `self.makeInterceptors()`. - func makesignScheduleInterceptors() -> [ServerInterceptor] +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_ScheduleService.ClientProtocol { + /// Call the "createSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new Schedule. + /// >

+ /// > If all signature requirements are met with this transaction, the + /// > scheduled transaction MAY execute immediately. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createSchedule( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createSchedule( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteSchedule'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteScheduleInterceptors() -> [ServerInterceptor] + /// Call the "signSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Add signatures to an existing schedule. + /// >

+ /// > Signatures on this transaction SHALL be added to the set of active + /// > signatures on the schedule, and MAY result in execution of the + /// > scheduled transaction if all signature requirements are met. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func signSchedule( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.signSchedule( + request: request, + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getScheduleInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetScheduleInfoInterceptors() -> [ServerInterceptor] -} + /// Call the "deleteSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mark an existing schedule deleted. + /// >

+ /// > Once deleted a schedule SHALL NOT be executed and any subsequent + /// > `scheduleSign` transaction SHALL fail. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteSchedule( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteSchedule( + request: request, + options: options, + onResponse: handleResponse + ) + } -public enum Proto_ScheduleServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "ScheduleService", - fullName: "proto.ScheduleService", - methods: [ - Proto_ScheduleServiceServerMetadata.Methods.createSchedule, - Proto_ScheduleServiceServerMetadata.Methods.signSchedule, - Proto_ScheduleServiceServerMetadata.Methods.deleteSchedule, - Proto_ScheduleServiceServerMetadata.Methods.getScheduleInfo, - ] - ) - - public enum Methods { - public static let createSchedule = GRPCMethodDescriptor( - name: "createSchedule", - path: "/proto.ScheduleService/createSchedule", - type: GRPCCallType.unary - ) - - public static let signSchedule = GRPCMethodDescriptor( - name: "signSchedule", - path: "/proto.ScheduleService/signSchedule", - type: GRPCCallType.unary - ) - - public static let deleteSchedule = GRPCMethodDescriptor( - name: "deleteSchedule", - path: "/proto.ScheduleService/deleteSchedule", - type: GRPCCallType.unary - ) - - public static let getScheduleInfo = GRPCMethodDescriptor( - name: "getScheduleInfo", - path: "/proto.ScheduleService/getScheduleInfo", - type: GRPCCallType.unary - ) - } -} + /// Call the "getScheduleInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a schedule. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getScheduleInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getScheduleInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/schedule_sign.grpc.swift b/Sources/HieroProtobufs/Generated/services/schedule_sign.grpc.swift new file mode 100644 index 00000000..2e3860b2 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/schedule_sign.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Schedule Sign +/// Transaction body for a `scheduleSign` transaction to add signatures +/// to an existing scheduled transaction. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/schedule_sign.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/smart_contract_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/smart_contract_service.grpc.swift index 087ae242..6381967c 100644 --- a/Sources/HieroProtobufs/Generated/services/smart_contract_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/smart_contract_service.grpc.swift @@ -1,1706 +1,3469 @@ -// +///* +/// # Smart Contract Service +/// gRPC service definitions for calls to the Hedera EVM-compatible +/// Smart Contract service. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/smart_contract_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// The Hedera Smart Contract Service (HSCS) provides an interface to an EVM -/// compatible environment to create, store, manage, and execute smart contract -/// calls. Smart Contracts implement useful and often highly complex -/// interactions between individuals, systems, and the distributed ledger. -/// -/// Usage: instantiate `Proto_SmartContractServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_SmartContractServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? { get } - - func createContract( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateContract( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func contractCallMethod( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func contractCallLocalMethod( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getContractInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func contractGetBytecode( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getBySolidityID( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getTxRecordByContractID( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteContract( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func systemDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func systemUndelete( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func callEthereum( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.SmartContractService + +/// Namespace containing generated types for the "proto.SmartContractService" service. +public enum Proto_SmartContractService { + /// Service descriptor for the "proto.SmartContractService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createContract" metadata. + public enum createContract { + /// Request type for "createContract". + public typealias Input = Proto_Transaction + /// Response type for "createContract". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createContract". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "createContract" + ) + } + /// Namespace for "updateContract" metadata. + public enum updateContract { + /// Request type for "updateContract". + public typealias Input = Proto_Transaction + /// Response type for "updateContract". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateContract". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "updateContract" + ) + } + /// Namespace for "contractCallMethod" metadata. + public enum contractCallMethod { + /// Request type for "contractCallMethod". + public typealias Input = Proto_Transaction + /// Response type for "contractCallMethod". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "contractCallMethod". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "contractCallMethod" + ) + } + /// Namespace for "contractCallLocalMethod" metadata. + public enum contractCallLocalMethod { + /// Request type for "contractCallLocalMethod". + public typealias Input = Proto_Query + /// Response type for "contractCallLocalMethod". + public typealias Output = Proto_Response + /// Descriptor for "contractCallLocalMethod". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "contractCallLocalMethod" + ) + } + /// Namespace for "getContractInfo" metadata. + public enum getContractInfo { + /// Request type for "getContractInfo". + public typealias Input = Proto_Query + /// Response type for "getContractInfo". + public typealias Output = Proto_Response + /// Descriptor for "getContractInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "getContractInfo" + ) + } + /// Namespace for "ContractGetBytecode" metadata. + public enum ContractGetBytecode { + /// Request type for "ContractGetBytecode". + public typealias Input = Proto_Query + /// Response type for "ContractGetBytecode". + public typealias Output = Proto_Response + /// Descriptor for "ContractGetBytecode". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "ContractGetBytecode" + ) + } + /// Namespace for "getBySolidityID" metadata. + public enum getBySolidityID { + /// Request type for "getBySolidityID". + public typealias Input = Proto_Query + /// Response type for "getBySolidityID". + public typealias Output = Proto_Response + /// Descriptor for "getBySolidityID". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "getBySolidityID" + ) + } + /// Namespace for "getTxRecordByContractID" metadata. + public enum getTxRecordByContractID { + /// Request type for "getTxRecordByContractID". + public typealias Input = Proto_Query + /// Response type for "getTxRecordByContractID". + public typealias Output = Proto_Response + /// Descriptor for "getTxRecordByContractID". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "getTxRecordByContractID" + ) + } + /// Namespace for "deleteContract" metadata. + public enum deleteContract { + /// Request type for "deleteContract". + public typealias Input = Proto_Transaction + /// Response type for "deleteContract". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteContract". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "deleteContract" + ) + } + /// Namespace for "systemDelete" metadata. + public enum systemDelete { + /// Request type for "systemDelete". + public typealias Input = Proto_Transaction + /// Response type for "systemDelete". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "systemDelete". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "systemDelete" + ) + } + /// Namespace for "systemUndelete" metadata. + public enum systemUndelete { + /// Request type for "systemUndelete". + public typealias Input = Proto_Transaction + /// Response type for "systemUndelete". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "systemUndelete". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "systemUndelete" + ) + } + /// Namespace for "callEthereum" metadata. + public enum callEthereum { + /// Request type for "callEthereum". + public typealias Input = Proto_Transaction + /// Response type for "callEthereum". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "callEthereum". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService"), + method: "callEthereum" + ) + } + /// Descriptors for all methods in the "proto.SmartContractService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createContract.descriptor, + updateContract.descriptor, + contractCallMethod.descriptor, + contractCallLocalMethod.descriptor, + getContractInfo.descriptor, + ContractGetBytecode.descriptor, + getBySolidityID.descriptor, + getTxRecordByContractID.descriptor, + deleteContract.descriptor, + systemDelete.descriptor, + systemUndelete.descriptor, + callEthereum.descriptor + ] + } } -extension Proto_SmartContractServiceClientProtocol { - public var serviceName: String { - return "proto.SmartContractService" - } - - ///* - /// Create a new smart contract. - ///

- /// If this transaction succeeds, the `ContractID` for the new smart - /// contract SHALL be set in the transaction receipt.
- /// The contract is defined by the initial bytecode (or `initcode`). - /// The `initcode` SHALL be provided either in a previously created file, - /// or in the transaction body itself for very small contracts.
- /// As part of contract creation, the constructor defined for the new - /// smart contract SHALL run with the parameters provided in - /// the `constructorParameters` field.
- /// The gas to "power" that constructor MUST be provided via the `gas` - /// field, and SHALL be charged to the payer for this transaction.
- /// If the contract _constructor_ stores information, it is charged gas for - /// that storage. There is a separate fee in HBAR to maintain that storage - /// until the expiration, and that fee SHALL be added to this transaction - /// as part of the _transaction fee_, rather than gas. - /// - /// - Parameters: - /// - request: Request to send to createContract. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createContract( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.createContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateContractInterceptors() ?? [] - ) - } - - ///* - /// Modify a smart contract.
- /// Any change other than updating the expiration time requires that the - /// contract be modifiable (has a valid `adminKey`) and that the - /// transaction be signed by the `adminKey` - ///

- /// Fields _not set_ on the request SHALL NOT be modified. - /// - /// - Parameters: - /// - request: Request to send to updateContract. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateContract( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.updateContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateContractInterceptors() ?? [] - ) - } - - ///* - /// Call a function of a given smart contract, providing function parameter - /// inputs as needed. - ///

- /// Resource ("gas") charges SHALL include all relevant fees incurred by - /// the contract execution, including any storage required.
- /// The total transaction fee SHALL incorporate all of the "gas" actually - /// consumed as well as the standard fees for transaction handling, - /// data transfers, signature verification, etc... - /// - /// - Parameters: - /// - request: Request to send to contractCallMethod. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func contractCallMethod( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractCallMethod.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecontractCallMethodInterceptors() ?? [] - ) - } - - ///* - /// Call a query function of a given smart contract, providing - /// function parameter inputs as needed.
- /// This is performed locally on the particular node that the client is - /// communicating with. Executing the call locally is faster and less - /// costly, but imposes certain restrictions. - ///

- /// The call MUST NOT change the state of the contract instance. This also - /// precludes any expenditure or transfer of HBAR or other tokens.
- /// The call SHALL NOT have a separate consensus timestamp.
- /// The call SHALL NOT generate a record nor a receipt.
- /// The response SHALL contain the output returned by the function call.
- ///

- /// This is generally useful for calling accessor functions which read - /// (query) state without changes or side effects. Any contract call that - /// would use the `STATICCALL` opcode MAY be called via contract call local - /// with performance and cost benefits. - ///

- /// Unlike a ContractCall transaction, the node SHALL always consume the - /// _entire_ amount of offered "gas" in determining the fee for this query, - /// so accurate gas estimation is important. - /// - /// - Parameters: - /// - request: Request to send to contractCallLocalMethod. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func contractCallLocalMethod( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractCallLocalMethod.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecontractCallLocalMethodInterceptors() ?? [] - ) - } - - ///* - /// A standard query to obtain detailed information for a smart contract. - /// - /// - Parameters: - /// - request: Request to send to getContractInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getContractInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getContractInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetContractInfoInterceptors() ?? [] - ) - } - - ///* - /// A standard query to read the current bytecode for a smart contract. - /// - /// - Parameters: - /// - request: Request to send to ContractGetBytecode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func contractGetBytecode( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractGetBytecode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeContractGetBytecodeInterceptors() ?? [] - ) - } - - ///* - /// A standard query to obtain account and contract identifiers for a smart - /// contract, given the Solidity identifier for that contract. - /// - /// - Parameters: - /// - request: Request to send to getBySolidityID. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getBySolidityID( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getBySolidityID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetBySolidityIDInterceptors() ?? [] - ) - } - - ///* - ///

This query is no longer supported.
- /// This query always returned an empty record list. - /// - /// - Parameters: - /// - request: Request to send to getTxRecordByContractID. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTxRecordByContractID( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getTxRecordByContractID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTxRecordByContractIDInterceptors() ?? [] - ) - } - - ///* - /// Delete a smart contract, and transfer any remaining HBAR balance - /// to a designated account. - ///

- /// If this call succeeds then all subsequent calls to that smart - /// contract SHALL fail.
- /// - /// - Parameters: - /// - request: Request to send to deleteContract. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteContract( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.deleteContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteContractInterceptors() ?? [] - ) - } - - ///* - /// Delete a smart contract, as a system-initiated deletion, this - /// SHALL NOT transfer balances. - ///

- /// This call is an administrative function of the Hedera network, and - /// SHALL require network administration authorization.
- /// This transaction MUST be signed by one of the network administration - /// accounts (typically `0.0.2` through `0.0.59`, as defined in the - /// `api-permission.properties` file). - ///
- /// If this call succeeds then all subsequent calls to that smart - /// contract SHALL fail.
- /// - /// - Parameters: - /// - request: Request to send to systemDelete. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func systemDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.systemDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [] - ) - } - - ///* - /// Un-Delete a smart contract, returning it (mostly) to its state - /// prior to deletion. - ///

- /// The contract to be restored MUST have been deleted via `systemDelete`. - /// If the contract was deleted via `deleteContract`, it - /// SHALL NOT be recoverable. - ///

- /// This call is an administrative function of the Hedera network, and - /// SHALL require network administration authorization.
- /// This transaction MUST be signed by one of the network administration - /// accounts (typically `0.0.2` through `0.0.59`, as defined in the - /// `api-permission.properties` file). - ///
- /// If this call succeeds then subsequent calls to that smart - /// contract MAY succeed.
- /// - /// - Parameters: - /// - request: Request to send to systemUndelete. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func systemUndelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.systemUndelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [] - ) - } - - ///* - /// Make an Ethereum transaction "call" with all data in Ethereum formats, - /// including the contract alias. - ///

- /// Call data MAY be in the transaction, or stored within a "File".
- /// The caller MAY offer additional gas above what is offered in the call - /// data, but MAY be charged up to 80% of that value if the amount required - /// is less than this "floor" amount. - /// - /// - Parameters: - /// - request: Request to send to callEthereum. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func callEthereum( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.callEthereum.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecallEthereumInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.SmartContractService" service. + public static let proto_SmartContractService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.SmartContractService") } -@available(*, deprecated) -extension Proto_SmartContractServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_SmartContractServiceNIOClient") -public final class Proto_SmartContractServiceClient: Proto_SmartContractServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.SmartContractService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.SmartContractService (server) + +extension Proto_SmartContractService { + /// Streaming variant of the service protocol for the "proto.SmartContractService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Smart Contract Service (HSCS) provides an interface to an EVM + /// > compatible environment to create, store, manage, and execute smart contract + /// > calls. Smart Contracts implement useful and often highly complex + /// > interactions between individuals, systems, and the distributed ledger. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createContract( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateContract( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func contractCallMethod( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func contractCallLocalMethod( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getContractInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func contractGetBytecode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getBySolidityID( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getTxRecordByContractID( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteContract( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func systemDelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func systemUndelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func callEthereum( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_SmartContractServiceNIOClient: Proto_SmartContractServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.SmartContractService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.SmartContractService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Smart Contract Service (HSCS) provides an interface to an EVM + /// > compatible environment to create, store, manage, and execute smart contract + /// > calls. Smart Contracts implement useful and often highly complex + /// > interactions between individuals, systems, and the distributed ledger. + public protocol ServiceProtocol: Proto_SmartContractService.StreamingServiceProtocol { + /// Handle the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createContract( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateContract( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func contractCallMethod( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func contractCallLocalMethod( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getContractInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func contractGetBytecode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getBySolidityID( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getTxRecordByContractID( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteContract( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func systemDelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func systemUndelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func callEthereum( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// The Hedera Smart Contract Service (HSCS) provides an interface to an EVM -/// compatible environment to create, store, manage, and execute smart contract -/// calls. Smart Contracts implement useful and often highly complex -/// interactions between individuals, systems, and the distributed ledger. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_SmartContractServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateContractCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateContractCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeContractCallMethodCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeContractCallLocalMethodCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetContractInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeContractGetBytecodeCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetBySolidityIDCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetTxRecordByContractIDCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteContractCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSystemDeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSystemUndeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCallEthereumCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.SmartContractService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Smart Contract Service (HSCS) provides an interface to an EVM + /// > compatible environment to create, store, manage, and execute smart contract + /// > calls. Smart Contracts implement useful and often highly complex + /// > interactions between individuals, systems, and the distributed ledger. + public protocol SimpleServiceProtocol: Proto_SmartContractService.ServiceProtocol { + /// Handle the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createContract( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateContract( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func contractCallMethod( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func contractCallLocalMethod( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getContractInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func contractGetBytecode( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getBySolidityID( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getTxRecordByContractID( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteContract( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func systemDelete( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func systemUndelete( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func callEthereum( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_SmartContractServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_SmartContractServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateContractCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.createContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateContractInterceptors() ?? [] - ) - } - - public func makeUpdateContractCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.updateContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateContractInterceptors() ?? [] - ) - } - - public func makeContractCallMethodCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractCallMethod.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecontractCallMethodInterceptors() ?? [] - ) - } - - public func makeContractCallLocalMethodCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractCallLocalMethod.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecontractCallLocalMethodInterceptors() ?? [] - ) - } - - public func makeGetContractInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getContractInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetContractInfoInterceptors() ?? [] - ) - } - - public func makeContractGetBytecodeCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractGetBytecode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeContractGetBytecodeInterceptors() ?? [] - ) - } - - public func makeGetBySolidityIDCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getBySolidityID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetBySolidityIDInterceptors() ?? [] - ) - } - - public func makeGetTxRecordByContractIDCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getTxRecordByContractID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTxRecordByContractIDInterceptors() ?? [] - ) - } - - public func makeDeleteContractCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.deleteContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteContractInterceptors() ?? [] - ) - } - - public func makeSystemDeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.systemDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [] - ) - } - - public func makeSystemUndeleteCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.systemUndelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [] - ) - } - - public func makeCallEthereumCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.callEthereum.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecallEthereumInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_SmartContractService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_SmartContractService.Method.createContract.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createContract( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.updateContract.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateContract( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.contractCallMethod.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.contractCallMethod( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.contractCallLocalMethod.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.contractCallLocalMethod( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.getContractInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getContractInfo( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.ContractGetBytecode.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.contractGetBytecode( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.getBySolidityID.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getBySolidityID( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.getTxRecordByContractID.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getTxRecordByContractID( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.deleteContract.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteContract( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.systemDelete.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.systemDelete( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.systemUndelete.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.systemUndelete( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_SmartContractService.Method.callEthereum.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.callEthereum( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_SmartContractServiceAsyncClientProtocol { - public func createContract( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.createContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateContractInterceptors() ?? [] - ) - } - - public func updateContract( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.updateContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateContractInterceptors() ?? [] - ) - } - - public func contractCallMethod( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractCallMethod.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecontractCallMethodInterceptors() ?? [] - ) - } - - public func contractCallLocalMethod( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractCallLocalMethod.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecontractCallLocalMethodInterceptors() ?? [] - ) - } - - public func getContractInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getContractInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetContractInfoInterceptors() ?? [] - ) - } - - public func contractGetBytecode( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.contractGetBytecode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeContractGetBytecodeInterceptors() ?? [] - ) - } - - public func getBySolidityID( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getBySolidityID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetBySolidityIDInterceptors() ?? [] - ) - } - - public func getTxRecordByContractID( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.getTxRecordByContractID.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTxRecordByContractIDInterceptors() ?? [] - ) - } - - public func deleteContract( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.deleteContract.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteContractInterceptors() ?? [] - ) - } - - public func systemDelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.systemDelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [] - ) - } - - public func systemUndelete( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.systemUndelete.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [] - ) - } - - public func callEthereum( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_SmartContractServiceClientMetadata.Methods.callEthereum.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecallEthereumInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_SmartContractService.ServiceProtocol { + public func createContract( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createContract( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_SmartContractServiceAsyncClient: Proto_SmartContractServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_SmartContractServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func updateContract( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateContract( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_SmartContractServiceClientInterceptorFactoryProtocol: Sendable { + public func contractCallMethod( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.contractCallMethod( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'createContract'. - func makecreateContractInterceptors() -> [ClientInterceptor] + public func contractCallLocalMethod( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.contractCallLocalMethod( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'updateContract'. - func makeupdateContractInterceptors() -> [ClientInterceptor] + public func getContractInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getContractInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'contractCallMethod'. - func makecontractCallMethodInterceptors() -> [ClientInterceptor] + public func contractGetBytecode( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.contractGetBytecode( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'contractCallLocalMethod'. - func makecontractCallLocalMethodInterceptors() -> [ClientInterceptor] + public func getBySolidityID( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getBySolidityID( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'getContractInfo'. - func makegetContractInfoInterceptors() -> [ClientInterceptor] + public func getTxRecordByContractID( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getTxRecordByContractID( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'contractGetBytecode'. - func makeContractGetBytecodeInterceptors() -> [ClientInterceptor] + public func deleteContract( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteContract( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'getBySolidityID'. - func makegetBySolidityIDInterceptors() -> [ClientInterceptor] + public func systemDelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.systemDelete( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'getTxRecordByContractID'. - func makegetTxRecordByContractIDInterceptors() -> [ClientInterceptor] + public func systemUndelete( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.systemUndelete( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'deleteContract'. - func makedeleteContractInterceptors() -> [ClientInterceptor] + public func callEthereum( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.callEthereum( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'systemDelete'. - func makesystemDeleteInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_SmartContractService.SimpleServiceProtocol { + public func createContract( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createContract( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'systemUndelete'. - func makesystemUndeleteInterceptors() -> [ClientInterceptor] + public func updateContract( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateContract( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'callEthereum'. - func makecallEthereumInterceptors() -> [ClientInterceptor] -} + public func contractCallMethod( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.contractCallMethod( + request: request.message, + context: context + ), + metadata: [:] + ) + } -public enum Proto_SmartContractServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "SmartContractService", - fullName: "proto.SmartContractService", - methods: [ - Proto_SmartContractServiceClientMetadata.Methods.createContract, - Proto_SmartContractServiceClientMetadata.Methods.updateContract, - Proto_SmartContractServiceClientMetadata.Methods.contractCallMethod, - Proto_SmartContractServiceClientMetadata.Methods.contractCallLocalMethod, - Proto_SmartContractServiceClientMetadata.Methods.getContractInfo, - Proto_SmartContractServiceClientMetadata.Methods.contractGetBytecode, - Proto_SmartContractServiceClientMetadata.Methods.getBySolidityID, - Proto_SmartContractServiceClientMetadata.Methods.getTxRecordByContractID, - Proto_SmartContractServiceClientMetadata.Methods.deleteContract, - Proto_SmartContractServiceClientMetadata.Methods.systemDelete, - Proto_SmartContractServiceClientMetadata.Methods.systemUndelete, - Proto_SmartContractServiceClientMetadata.Methods.callEthereum, - ] - ) - - public enum Methods { - public static let createContract = GRPCMethodDescriptor( - name: "createContract", - path: "/proto.SmartContractService/createContract", - type: GRPCCallType.unary - ) - - public static let updateContract = GRPCMethodDescriptor( - name: "updateContract", - path: "/proto.SmartContractService/updateContract", - type: GRPCCallType.unary - ) - - public static let contractCallMethod = GRPCMethodDescriptor( - name: "contractCallMethod", - path: "/proto.SmartContractService/contractCallMethod", - type: GRPCCallType.unary - ) - - public static let contractCallLocalMethod = GRPCMethodDescriptor( - name: "contractCallLocalMethod", - path: "/proto.SmartContractService/contractCallLocalMethod", - type: GRPCCallType.unary - ) - - public static let getContractInfo = GRPCMethodDescriptor( - name: "getContractInfo", - path: "/proto.SmartContractService/getContractInfo", - type: GRPCCallType.unary - ) - - public static let contractGetBytecode = GRPCMethodDescriptor( - name: "ContractGetBytecode", - path: "/proto.SmartContractService/ContractGetBytecode", - type: GRPCCallType.unary - ) - - public static let getBySolidityID = GRPCMethodDescriptor( - name: "getBySolidityID", - path: "/proto.SmartContractService/getBySolidityID", - type: GRPCCallType.unary - ) - - public static let getTxRecordByContractID = GRPCMethodDescriptor( - name: "getTxRecordByContractID", - path: "/proto.SmartContractService/getTxRecordByContractID", - type: GRPCCallType.unary - ) - - public static let deleteContract = GRPCMethodDescriptor( - name: "deleteContract", - path: "/proto.SmartContractService/deleteContract", - type: GRPCCallType.unary - ) - - public static let systemDelete = GRPCMethodDescriptor( - name: "systemDelete", - path: "/proto.SmartContractService/systemDelete", - type: GRPCCallType.unary - ) - - public static let systemUndelete = GRPCMethodDescriptor( - name: "systemUndelete", - path: "/proto.SmartContractService/systemUndelete", - type: GRPCCallType.unary - ) - - public static let callEthereum = GRPCMethodDescriptor( - name: "callEthereum", - path: "/proto.SmartContractService/callEthereum", - type: GRPCCallType.unary - ) - } -} + public func contractCallLocalMethod( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.contractCallLocalMethod( + request: request.message, + context: context + ), + metadata: [:] + ) + } -///* -/// The Hedera Smart Contract Service (HSCS) provides an interface to an EVM -/// compatible environment to create, store, manage, and execute smart contract -/// calls. Smart Contracts implement useful and often highly complex -/// interactions between individuals, systems, and the distributed ledger. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_SmartContractServiceProvider: CallHandlerProvider { - var interceptors: Proto_SmartContractServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new smart contract. - ///

- /// If this transaction succeeds, the `ContractID` for the new smart - /// contract SHALL be set in the transaction receipt.
- /// The contract is defined by the initial bytecode (or `initcode`). - /// The `initcode` SHALL be provided either in a previously created file, - /// or in the transaction body itself for very small contracts.
- /// As part of contract creation, the constructor defined for the new - /// smart contract SHALL run with the parameters provided in - /// the `constructorParameters` field.
- /// The gas to "power" that constructor MUST be provided via the `gas` - /// field, and SHALL be charged to the payer for this transaction.
- /// If the contract _constructor_ stores information, it is charged gas for - /// that storage. There is a separate fee in HBAR to maintain that storage - /// until the expiration, and that fee SHALL be added to this transaction - /// as part of the _transaction fee_, rather than gas. - func createContract(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Modify a smart contract.
- /// Any change other than updating the expiration time requires that the - /// contract be modifiable (has a valid `adminKey`) and that the - /// transaction be signed by the `adminKey` - ///

- /// Fields _not set_ on the request SHALL NOT be modified. - func updateContract(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Call a function of a given smart contract, providing function parameter - /// inputs as needed. - ///

- /// Resource ("gas") charges SHALL include all relevant fees incurred by - /// the contract execution, including any storage required.
- /// The total transaction fee SHALL incorporate all of the "gas" actually - /// consumed as well as the standard fees for transaction handling, - /// data transfers, signature verification, etc... - func contractCallMethod(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Call a query function of a given smart contract, providing - /// function parameter inputs as needed.
- /// This is performed locally on the particular node that the client is - /// communicating with. Executing the call locally is faster and less - /// costly, but imposes certain restrictions. - ///

- /// The call MUST NOT change the state of the contract instance. This also - /// precludes any expenditure or transfer of HBAR or other tokens.
- /// The call SHALL NOT have a separate consensus timestamp.
- /// The call SHALL NOT generate a record nor a receipt.
- /// The response SHALL contain the output returned by the function call.
- ///

- /// This is generally useful for calling accessor functions which read - /// (query) state without changes or side effects. Any contract call that - /// would use the `STATICCALL` opcode MAY be called via contract call local - /// with performance and cost benefits. - ///

- /// Unlike a ContractCall transaction, the node SHALL always consume the - /// _entire_ amount of offered "gas" in determining the fee for this query, - /// so accurate gas estimation is important. - func contractCallLocalMethod(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// A standard query to obtain detailed information for a smart contract. - func getContractInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// A standard query to read the current bytecode for a smart contract. - func contractGetBytecode(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// A standard query to obtain account and contract identifiers for a smart - /// contract, given the Solidity identifier for that contract. - func getBySolidityID(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - ///

This query is no longer supported.
- /// This query always returned an empty record list. - func getTxRecordByContractID(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete a smart contract, and transfer any remaining HBAR balance - /// to a designated account. - ///

- /// If this call succeeds then all subsequent calls to that smart - /// contract SHALL fail.
- func deleteContract(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete a smart contract, as a system-initiated deletion, this - /// SHALL NOT transfer balances. - ///

- /// This call is an administrative function of the Hedera network, and - /// SHALL require network administration authorization.
- /// This transaction MUST be signed by one of the network administration - /// accounts (typically `0.0.2` through `0.0.59`, as defined in the - /// `api-permission.properties` file). - ///
- /// If this call succeeds then all subsequent calls to that smart - /// contract SHALL fail.
- func systemDelete(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Un-Delete a smart contract, returning it (mostly) to its state - /// prior to deletion. - ///

- /// The contract to be restored MUST have been deleted via `systemDelete`. - /// If the contract was deleted via `deleteContract`, it - /// SHALL NOT be recoverable. - ///

- /// This call is an administrative function of the Hedera network, and - /// SHALL require network administration authorization.
- /// This transaction MUST be signed by one of the network administration - /// accounts (typically `0.0.2` through `0.0.59`, as defined in the - /// `api-permission.properties` file). - ///
- /// If this call succeeds then subsequent calls to that smart - /// contract MAY succeed.
- func systemUndelete(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Make an Ethereum transaction "call" with all data in Ethereum formats, - /// including the contract alias. - ///

- /// Call data MAY be in the transaction, or stored within a "File".
- /// The caller MAY offer additional gas above what is offered in the call - /// data, but MAY be charged up to 80% of that value if the amount required - /// is less than this "floor" amount. - func callEthereum(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture -} + public func getContractInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getContractInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } -extension Proto_SmartContractServiceProvider { - public var serviceName: Substring { - return Proto_SmartContractServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createContract": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateContractInterceptors() ?? [], - userFunction: self.createContract(request:context:) - ) - - case "updateContract": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateContractInterceptors() ?? [], - userFunction: self.updateContract(request:context:) - ) - - case "contractCallMethod": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecontractCallMethodInterceptors() ?? [], - userFunction: self.contractCallMethod(request:context:) - ) - - case "contractCallLocalMethod": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecontractCallLocalMethodInterceptors() ?? [], - userFunction: self.contractCallLocalMethod(request:context:) - ) - - case "getContractInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetContractInfoInterceptors() ?? [], - userFunction: self.getContractInfo(request:context:) - ) - - case "ContractGetBytecode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeContractGetBytecodeInterceptors() ?? [], - userFunction: self.contractGetBytecode(request:context:) - ) - - case "getBySolidityID": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetBySolidityIDInterceptors() ?? [], - userFunction: self.getBySolidityID(request:context:) - ) - - case "getTxRecordByContractID": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTxRecordByContractIDInterceptors() ?? [], - userFunction: self.getTxRecordByContractID(request:context:) - ) - - case "deleteContract": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteContractInterceptors() ?? [], - userFunction: self.deleteContract(request:context:) - ) - - case "systemDelete": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [], - userFunction: self.systemDelete(request:context:) - ) - - case "systemUndelete": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [], - userFunction: self.systemUndelete(request:context:) - ) - - case "callEthereum": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecallEthereumInterceptors() ?? [], - userFunction: self.callEthereum(request:context:) - ) - - default: - return nil + public func contractGetBytecode( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.contractGetBytecode( + request: request.message, + context: context + ), + metadata: [:] + ) } - } -} -///* -/// The Hedera Smart Contract Service (HSCS) provides an interface to an EVM -/// compatible environment to create, store, manage, and execute smart contract -/// calls. Smart Contracts implement useful and often highly complex -/// interactions between individuals, systems, and the distributed ledger. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_SmartContractServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_SmartContractServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new smart contract. - ///

- /// If this transaction succeeds, the `ContractID` for the new smart - /// contract SHALL be set in the transaction receipt.
- /// The contract is defined by the initial bytecode (or `initcode`). - /// The `initcode` SHALL be provided either in a previously created file, - /// or in the transaction body itself for very small contracts.
- /// As part of contract creation, the constructor defined for the new - /// smart contract SHALL run with the parameters provided in - /// the `constructorParameters` field.
- /// The gas to "power" that constructor MUST be provided via the `gas` - /// field, and SHALL be charged to the payer for this transaction.
- /// If the contract _constructor_ stores information, it is charged gas for - /// that storage. There is a separate fee in HBAR to maintain that storage - /// until the expiration, and that fee SHALL be added to this transaction - /// as part of the _transaction fee_, rather than gas. - func createContract( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Modify a smart contract.
- /// Any change other than updating the expiration time requires that the - /// contract be modifiable (has a valid `adminKey`) and that the - /// transaction be signed by the `adminKey` - ///

- /// Fields _not set_ on the request SHALL NOT be modified. - func updateContract( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Call a function of a given smart contract, providing function parameter - /// inputs as needed. - ///

- /// Resource ("gas") charges SHALL include all relevant fees incurred by - /// the contract execution, including any storage required.
- /// The total transaction fee SHALL incorporate all of the "gas" actually - /// consumed as well as the standard fees for transaction handling, - /// data transfers, signature verification, etc... - func contractCallMethod( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Call a query function of a given smart contract, providing - /// function parameter inputs as needed.
- /// This is performed locally on the particular node that the client is - /// communicating with. Executing the call locally is faster and less - /// costly, but imposes certain restrictions. - ///

- /// The call MUST NOT change the state of the contract instance. This also - /// precludes any expenditure or transfer of HBAR or other tokens.
- /// The call SHALL NOT have a separate consensus timestamp.
- /// The call SHALL NOT generate a record nor a receipt.
- /// The response SHALL contain the output returned by the function call.
- ///

- /// This is generally useful for calling accessor functions which read - /// (query) state without changes or side effects. Any contract call that - /// would use the `STATICCALL` opcode MAY be called via contract call local - /// with performance and cost benefits. - ///

- /// Unlike a ContractCall transaction, the node SHALL always consume the - /// _entire_ amount of offered "gas" in determining the fee for this query, - /// so accurate gas estimation is important. - func contractCallLocalMethod( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// A standard query to obtain detailed information for a smart contract. - func getContractInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// A standard query to read the current bytecode for a smart contract. - func contractGetBytecode( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// A standard query to obtain account and contract identifiers for a smart - /// contract, given the Solidity identifier for that contract. - func getBySolidityID( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - ///

This query is no longer supported.
- /// This query always returned an empty record list. - func getTxRecordByContractID( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Delete a smart contract, and transfer any remaining HBAR balance - /// to a designated account. - ///

- /// If this call succeeds then all subsequent calls to that smart - /// contract SHALL fail.
- func deleteContract( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete a smart contract, as a system-initiated deletion, this - /// SHALL NOT transfer balances. - ///

- /// This call is an administrative function of the Hedera network, and - /// SHALL require network administration authorization.
- /// This transaction MUST be signed by one of the network administration - /// accounts (typically `0.0.2` through `0.0.59`, as defined in the - /// `api-permission.properties` file). - ///
- /// If this call succeeds then all subsequent calls to that smart - /// contract SHALL fail.
- func systemDelete( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Un-Delete a smart contract, returning it (mostly) to its state - /// prior to deletion. - ///

- /// The contract to be restored MUST have been deleted via `systemDelete`. - /// If the contract was deleted via `deleteContract`, it - /// SHALL NOT be recoverable. - ///

- /// This call is an administrative function of the Hedera network, and - /// SHALL require network administration authorization.
- /// This transaction MUST be signed by one of the network administration - /// accounts (typically `0.0.2` through `0.0.59`, as defined in the - /// `api-permission.properties` file). - ///
- /// If this call succeeds then subsequent calls to that smart - /// contract MAY succeed.
- func systemUndelete( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Make an Ethereum transaction "call" with all data in Ethereum formats, - /// including the contract alias. - ///

- /// Call data MAY be in the transaction, or stored within a "File".
- /// The caller MAY offer additional gas above what is offered in the call - /// data, but MAY be charged up to 80% of that value if the amount required - /// is less than this "floor" amount. - func callEthereum( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse -} + public func getBySolidityID( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getBySolidityID( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func getTxRecordByContractID( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getTxRecordByContractID( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func deleteContract( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteContract( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func systemDelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.systemDelete( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func systemUndelete( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.systemUndelete( + request: request.message, + context: context + ), + metadata: [:] + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_SmartContractServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_SmartContractServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_SmartContractServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_SmartContractServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createContract": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateContractInterceptors() ?? [], - wrapping: { try await self.createContract(request: $0, context: $1) } - ) - - case "updateContract": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateContractInterceptors() ?? [], - wrapping: { try await self.updateContract(request: $0, context: $1) } - ) - - case "contractCallMethod": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecontractCallMethodInterceptors() ?? [], - wrapping: { try await self.contractCallMethod(request: $0, context: $1) } - ) - - case "contractCallLocalMethod": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecontractCallLocalMethodInterceptors() ?? [], - wrapping: { try await self.contractCallLocalMethod(request: $0, context: $1) } - ) - - case "getContractInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetContractInfoInterceptors() ?? [], - wrapping: { try await self.getContractInfo(request: $0, context: $1) } - ) - - case "ContractGetBytecode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeContractGetBytecodeInterceptors() ?? [], - wrapping: { try await self.contractGetBytecode(request: $0, context: $1) } - ) - - case "getBySolidityID": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetBySolidityIDInterceptors() ?? [], - wrapping: { try await self.getBySolidityID(request: $0, context: $1) } - ) - - case "getTxRecordByContractID": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTxRecordByContractIDInterceptors() ?? [], - wrapping: { try await self.getTxRecordByContractID(request: $0, context: $1) } - ) - - case "deleteContract": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteContractInterceptors() ?? [], - wrapping: { try await self.deleteContract(request: $0, context: $1) } - ) - - case "systemDelete": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemDeleteInterceptors() ?? [], - wrapping: { try await self.systemDelete(request: $0, context: $1) } - ) - - case "systemUndelete": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesystemUndeleteInterceptors() ?? [], - wrapping: { try await self.systemUndelete(request: $0, context: $1) } - ) - - case "callEthereum": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecallEthereumInterceptors() ?? [], - wrapping: { try await self.callEthereum(request: $0, context: $1) } - ) - - default: - return nil + public func callEthereum( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.callEthereum( + request: request.message, + context: context + ), + metadata: [:] + ) } - } } -public protocol Proto_SmartContractServiceServerInterceptorFactoryProtocol: Sendable { +// MARK: proto.SmartContractService (client) + +extension Proto_SmartContractService { + /// Generated client protocol for the "proto.SmartContractService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Smart Contract Service (HSCS) provides an interface to an EVM + /// > compatible environment to create, store, manage, and execute smart contract + /// > calls. Smart Contracts implement useful and often highly complex + /// > interactions between individuals, systems, and the distributed ledger. + public protocol ClientProtocol: Sendable { + /// Call the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createContract( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateContract( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func contractCallMethod( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func contractCallLocalMethod( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getContractInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func contractGetBytecode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getBySolidityID( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getTxRecordByContractID( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteContract( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func systemDelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func systemUndelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func callEthereum( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } + + /// Generated client for the "proto.SmartContractService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Hedera Smart Contract Service (HSCS) provides an interface to an EVM + /// > compatible environment to create, store, manage, and execute smart contract + /// > calls. Smart Contracts implement useful and often highly complex + /// > interactions between individuals, systems, and the distributed ledger. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createContract( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.createContract.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateContract( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.updateContract.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractCallMethod( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.contractCallMethod.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractCallLocalMethod( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.contractCallLocalMethod.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getContractInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.getContractInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractGetBytecode( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.ContractGetBytecode.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getBySolidityID( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.getBySolidityID.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTxRecordByContractID( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.getTxRecordByContractID.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteContract( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.deleteContract.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemDelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.systemDelete.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemUndelete( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.systemUndelete.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func callEthereum( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_SmartContractService.Method.callEthereum.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + } +} - /// - Returns: Interceptors to use when handling 'createContract'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateContractInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_SmartContractService.ClientProtocol { + /// Call the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createContract( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createContract( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'updateContract'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateContractInterceptors() -> [ServerInterceptor] + /// Call the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateContract( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateContract( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'contractCallMethod'. - /// Defaults to calling `self.makeInterceptors()`. - func makecontractCallMethodInterceptors() -> [ServerInterceptor] + /// Call the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractCallMethod( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.contractCallMethod( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'contractCallLocalMethod'. - /// Defaults to calling `self.makeInterceptors()`. - func makecontractCallLocalMethodInterceptors() -> [ServerInterceptor] + /// Call the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractCallLocalMethod( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.contractCallLocalMethod( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getContractInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetContractInfoInterceptors() -> [ServerInterceptor] + /// Call the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getContractInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getContractInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'contractGetBytecode'. - /// Defaults to calling `self.makeInterceptors()`. - func makeContractGetBytecodeInterceptors() -> [ServerInterceptor] + /// Call the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractGetBytecode( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.contractGetBytecode( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getBySolidityID'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetBySolidityIDInterceptors() -> [ServerInterceptor] + /// Call the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getBySolidityID( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getBySolidityID( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getTxRecordByContractID'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetTxRecordByContractIDInterceptors() -> [ServerInterceptor] + /// Call the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTxRecordByContractID( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getTxRecordByContractID( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteContract'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteContractInterceptors() -> [ServerInterceptor] + /// Call the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteContract( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteContract( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'systemDelete'. - /// Defaults to calling `self.makeInterceptors()`. - func makesystemDeleteInterceptors() -> [ServerInterceptor] + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemDelete( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.systemDelete( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'systemUndelete'. - /// Defaults to calling `self.makeInterceptors()`. - func makesystemUndeleteInterceptors() -> [ServerInterceptor] + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemUndelete( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.systemUndelete( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'callEthereum'. - /// Defaults to calling `self.makeInterceptors()`. - func makecallEthereumInterceptors() -> [ServerInterceptor] + /// Call the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func callEthereum( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.callEthereum( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } -public enum Proto_SmartContractServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "SmartContractService", - fullName: "proto.SmartContractService", - methods: [ - Proto_SmartContractServiceServerMetadata.Methods.createContract, - Proto_SmartContractServiceServerMetadata.Methods.updateContract, - Proto_SmartContractServiceServerMetadata.Methods.contractCallMethod, - Proto_SmartContractServiceServerMetadata.Methods.contractCallLocalMethod, - Proto_SmartContractServiceServerMetadata.Methods.getContractInfo, - Proto_SmartContractServiceServerMetadata.Methods.contractGetBytecode, - Proto_SmartContractServiceServerMetadata.Methods.getBySolidityID, - Proto_SmartContractServiceServerMetadata.Methods.getTxRecordByContractID, - Proto_SmartContractServiceServerMetadata.Methods.deleteContract, - Proto_SmartContractServiceServerMetadata.Methods.systemDelete, - Proto_SmartContractServiceServerMetadata.Methods.systemUndelete, - Proto_SmartContractServiceServerMetadata.Methods.callEthereum, - ] - ) - - public enum Methods { - public static let createContract = GRPCMethodDescriptor( - name: "createContract", - path: "/proto.SmartContractService/createContract", - type: GRPCCallType.unary - ) - - public static let updateContract = GRPCMethodDescriptor( - name: "updateContract", - path: "/proto.SmartContractService/updateContract", - type: GRPCCallType.unary - ) - - public static let contractCallMethod = GRPCMethodDescriptor( - name: "contractCallMethod", - path: "/proto.SmartContractService/contractCallMethod", - type: GRPCCallType.unary - ) - - public static let contractCallLocalMethod = GRPCMethodDescriptor( - name: "contractCallLocalMethod", - path: "/proto.SmartContractService/contractCallLocalMethod", - type: GRPCCallType.unary - ) - - public static let getContractInfo = GRPCMethodDescriptor( - name: "getContractInfo", - path: "/proto.SmartContractService/getContractInfo", - type: GRPCCallType.unary - ) - - public static let contractGetBytecode = GRPCMethodDescriptor( - name: "ContractGetBytecode", - path: "/proto.SmartContractService/ContractGetBytecode", - type: GRPCCallType.unary - ) - - public static let getBySolidityID = GRPCMethodDescriptor( - name: "getBySolidityID", - path: "/proto.SmartContractService/getBySolidityID", - type: GRPCCallType.unary - ) - - public static let getTxRecordByContractID = GRPCMethodDescriptor( - name: "getTxRecordByContractID", - path: "/proto.SmartContractService/getTxRecordByContractID", - type: GRPCCallType.unary - ) - - public static let deleteContract = GRPCMethodDescriptor( - name: "deleteContract", - path: "/proto.SmartContractService/deleteContract", - type: GRPCCallType.unary - ) - - public static let systemDelete = GRPCMethodDescriptor( - name: "systemDelete", - path: "/proto.SmartContractService/systemDelete", - type: GRPCCallType.unary - ) - - public static let systemUndelete = GRPCMethodDescriptor( - name: "systemUndelete", - path: "/proto.SmartContractService/systemUndelete", - type: GRPCCallType.unary - ) - - public static let callEthereum = GRPCMethodDescriptor( - name: "callEthereum", - path: "/proto.SmartContractService/callEthereum", - type: GRPCCallType.unary - ) - } -} +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_SmartContractService.ClientProtocol { + /// Call the "createContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new smart contract. + /// >

+ /// > If this transaction succeeds, the `ContractID` for the new smart + /// > contract SHALL be set in the transaction receipt.
+ /// > The contract is defined by the initial bytecode (or `initcode`). + /// > The `initcode` SHALL be provided either in a previously created file, + /// > or in the transaction body itself for very small contracts.
+ /// > As part of contract creation, the constructor defined for the new + /// > smart contract SHALL run with the parameters provided in + /// > the `constructorParameters` field.
+ /// > The gas to "power" that constructor MUST be provided via the `gas` + /// > field, and SHALL be charged to the payer for this transaction.
+ /// > If the contract _constructor_ stores information, it is charged gas for + /// > that storage. There is a separate fee in HBAR to maintain that storage + /// > until the expiration, and that fee SHALL be added to this transaction + /// > as part of the _transaction fee_, rather than gas. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createContract( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createContract( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Modify a smart contract.
+ /// > Any change other than updating the expiration time requires that the + /// > contract be modifiable (has a valid `adminKey`) and that the + /// > transaction be signed by the `adminKey` + /// >

+ /// > Fields _not set_ on the request SHALL NOT be modified. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateContract( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateContract( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "contractCallMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a function of a given smart contract, providing function parameter + /// > inputs as needed. + /// >

+ /// > Resource ("gas") charges SHALL include all relevant fees incurred by + /// > the contract execution, including any storage required.
+ /// > The total transaction fee SHALL incorporate all of the "gas" actually + /// > consumed as well as the standard fees for transaction handling, + /// > data transfers, signature verification, etc... + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractCallMethod( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.contractCallMethod( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "contractCallLocalMethod" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Call a query function of a given smart contract, providing + /// > function parameter inputs as needed.
+ /// > This is performed locally on the particular node that the client is + /// > communicating with. Executing the call locally is faster and less + /// > costly, but imposes certain restrictions. + /// >

+ /// > The call MUST NOT change the state of the contract instance. This also + /// > precludes any expenditure or transfer of HBAR or other tokens.
+ /// > The call SHALL NOT have a separate consensus timestamp.
+ /// > The call SHALL NOT generate a record nor a receipt.
+ /// > The response SHALL contain the output returned by the function call.
+ /// >

+ /// > This is generally useful for calling accessor functions which read + /// > (query) state without changes or side effects. Any contract call that + /// > would use the `STATICCALL` opcode MAY be called via contract call local + /// > with performance and cost benefits. + /// >

+ /// > Unlike a ContractCall transaction, the node SHALL always consume the + /// > _entire_ amount of offered "gas" in determining the fee for this query, + /// > so accurate gas estimation is important. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractCallLocalMethod( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.contractCallLocalMethod( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getContractInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain detailed information for a smart contract. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getContractInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getContractInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "ContractGetBytecode" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to read the current bytecode for a smart contract. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func contractGetBytecode( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.contractGetBytecode( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getBySolidityID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > A standard query to obtain account and contract identifiers for a smart + /// > contract, given the Solidity identifier for that contract. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getBySolidityID( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getBySolidityID( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTxRecordByContractID" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// >

This query is no longer supported.
+ /// > This query always returned an empty record list. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTxRecordByContractID( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getTxRecordByContractID( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteContract" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, and transfer any remaining HBAR balance + /// > to a designated account. + /// >

+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteContract( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteContract( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemDelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a smart contract, as a system-initiated deletion, this + /// > SHALL NOT transfer balances. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then all subsequent calls to that smart + /// > contract SHALL fail.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemDelete( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.systemDelete( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "systemUndelete" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Un-Delete a smart contract, returning it (mostly) to its state + /// > prior to deletion. + /// >

+ /// > The contract to be restored MUST have been deleted via `systemDelete`. + /// > If the contract was deleted via `deleteContract`, it + /// > SHALL NOT be recoverable. + /// >

+ /// > This call is an administrative function of the Hedera network, and + /// > SHALL require network administration authorization.
+ /// > This transaction MUST be signed by one of the network administration + /// > accounts (typically `0.0.2` through `0.0.59`, as defined in the + /// > `api-permission.properties` file). + /// >
+ /// > If this call succeeds then subsequent calls to that smart + /// > contract MAY succeed.
+ /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func systemUndelete( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.systemUndelete( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "callEthereum" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Make an Ethereum transaction "call" with all data in Ethereum formats, + /// > including the contract alias. + /// >

+ /// > Call data MAY be in the transaction, or stored within a "File".
+ /// > The caller MAY offer additional gas above what is offered in the call + /// > data, but MAY be charged up to 80% of that value if the amount required + /// > is less than this "floor" amount. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func callEthereum( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.callEthereum( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/state/hints/hints_types.grpc.swift b/Sources/HieroProtobufs/Generated/services/state/hints/hints_types.grpc.swift new file mode 100644 index 00000000..ab48a1c1 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/state/hints/hints_types.grpc.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/state/hints/hints_types.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/state/history/history_types.grpc.swift b/Sources/HieroProtobufs/Generated/services/state/history/history_types.grpc.swift new file mode 100644 index 00000000..bedee70b --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/state/history/history_types.grpc.swift @@ -0,0 +1,10 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/state/history/history_types.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/system_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/system_delete.grpc.swift new file mode 100644 index 00000000..ad394ee9 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/system_delete.grpc.swift @@ -0,0 +1,32 @@ +///* +/// # System Delete +/// A system transaction to remove a file from the Hedera File +/// Service (HFS).
+/// This transaction is a privileged operation restricted to "system" +/// accounts. +/// +/// > Note +/// >> System delete is defined here for a smart contract (to delete +/// >> the bytecode), but was never implemented. +/// > +/// >> Currently, system delete and system undelete specifying a smart +/// >> contract identifier SHALL return `INVALID_FILE_ID` +/// >> or `MISSING_ENTITY_ID`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/system_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/system_undelete.grpc.swift b/Sources/HieroProtobufs/Generated/services/system_undelete.grpc.swift new file mode 100644 index 00000000..5b441e13 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/system_undelete.grpc.swift @@ -0,0 +1,31 @@ +///* +/// # System Undelete +/// A system transaction to "undo" a `systemDelete` transaction.
+/// This transaction is a privileged operation restricted to "system" +/// accounts. +/// +/// > Note +/// >> System undelete is defined here for a smart contract (to delete +/// >> the bytecode), but was never implemented. +/// > +/// >> Currently, system delete and system undelete specifying a smart +/// >> contract identifier SHALL return `INVALID_FILE_ID` +/// >> or `MISSING_ENTITY_ID`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/system_undelete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/throttle_definitions.grpc.swift b/Sources/HieroProtobufs/Generated/services/throttle_definitions.grpc.swift new file mode 100644 index 00000000..c4d0b193 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/throttle_definitions.grpc.swift @@ -0,0 +1,29 @@ +///* +/// # Throttle Definitions +/// A set of messages that support maintaining throttling limits on network +/// transactions to ensure no one transaction type consumes the entirety of +/// network resources. Also used to charge congestion fees when network load +/// is exceptionally high, as an incentive to delay transactions that are +/// not time-sensitive. +/// +/// For details behind this throttling design, please see the +/// `docs/throttle-design.md` document in the +/// [Hedera Services](https://github.com/hashgraph/hedera-services) repository. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/throttle_definitions.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/timestamp.grpc.swift b/Sources/HieroProtobufs/Generated/services/timestamp.grpc.swift new file mode 100644 index 00000000..c444d713 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/timestamp.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/timestamp.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_airdrop.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_airdrop.grpc.swift new file mode 100644 index 00000000..26251152 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_airdrop.grpc.swift @@ -0,0 +1,24 @@ +///* +/// # Token Airdrop +/// Messages used to implement a transaction to "airdrop" tokens.
+/// An "airdrop" is a distribution of tokens from a funding account +/// to one or more recipient accounts, ideally with no action required +/// by the recipient account(s). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_airdrop.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_associate.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_associate.grpc.swift new file mode 100644 index 00000000..4f29b40e --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_associate.grpc.swift @@ -0,0 +1,31 @@ +///* +/// # Token Associate +/// Transaction to associate an Hedera Token Service (HTS) token with an +/// account.
+/// Accounts cannot transact in a token (send or receive) until the account +/// and token are associated. +/// +/// > Note +/// >> An "airdrop" transaction MAY initiate sending tokens to an +/// >> unassociated account, but the transfer remains in a "pending" +/// >> state until the recipient executes a "claim" transaction +/// >> that both accepts the tokens and associates that account +/// >> with the 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_associate.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_burn.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_burn.grpc.swift new file mode 100644 index 00000000..cbc71ad6 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_burn.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Token Burn +/// Permanently remove tokens from circulation, akin to how a fiat treasury +/// will physically burn worn out bank notes. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_burn.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_cancel_airdrop.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_cancel_airdrop.grpc.swift new file mode 100644 index 00000000..ee3d3eb8 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_cancel_airdrop.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Cancel Airdrop +/// Messages used to implement a transaction to cancel a pending airdrop. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_cancel_airdrop.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_claim_airdrop.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_claim_airdrop.grpc.swift new file mode 100644 index 00000000..4a8fcb73 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_claim_airdrop.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Claim Airdrop +/// Messages used to implement a transaction to claim a pending airdrop. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_claim_airdrop.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_create.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_create.grpc.swift new file mode 100644 index 00000000..ab6c7c20 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_create.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Create +/// Create an Hedera Token Service (HTS) token. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_create.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_delete.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_delete.grpc.swift new file mode 100644 index 00000000..462531dd --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_delete.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Delete +/// Delete an Hedera Token Service (HTS) token. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_delete.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_dissociate.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_dissociate.grpc.swift new file mode 100644 index 00000000..0a7aaadb --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_dissociate.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Token Dissociate +/// Remove association between an account and one or more Hedera Token +/// Service (HTS) tokens. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_dissociate.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_fee_schedule_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_fee_schedule_update.grpc.swift new file mode 100644 index 00000000..3e4219ce --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_fee_schedule_update.grpc.swift @@ -0,0 +1,24 @@ +///* +/// # Fee Schedule Update +/// Transaction to update the fee schedule for a token. A token creator may +/// wish to charge custom transaction fees for a token type, and if a +/// `fee_schedule_key` is assigned, this transaction enables adding, removing, +/// or updating those custom transaction fees. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_fee_schedule_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_freeze_account.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_freeze_account.grpc.swift new file mode 100644 index 00000000..f409020c --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_freeze_account.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Freeze Account +/// Freeze all tokens of an identified type for an identified account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_freeze_account.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_get_account_nft_infos.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_get_account_nft_infos.grpc.swift new file mode 100644 index 00000000..7c0b47ee --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_get_account_nft_infos.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Account NFT Infos +/// Deprecated and permanently disabled +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_get_account_nft_infos.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_get_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_get_info.grpc.swift new file mode 100644 index 00000000..a7caeae0 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_get_info.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Get Token Info +/// Query to retrieve information for a single token. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_get_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_get_nft_info.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_get_nft_info.grpc.swift new file mode 100644 index 00000000..2d8ad1c0 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_get_nft_info.grpc.swift @@ -0,0 +1,20 @@ +///* +/// # Get NFT Info 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_get_nft_info.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_get_nft_infos.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_get_nft_infos.grpc.swift new file mode 100644 index 00000000..efd99489 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_get_nft_infos.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Get NFT Infos +/// Deprecated and permanently disabled +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_get_nft_infos.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_grant_kyc.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_grant_kyc.grpc.swift new file mode 100644 index 00000000..10ceb5ce --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_grant_kyc.grpc.swift @@ -0,0 +1,30 @@ +///* +/// # Token Grant KYC +/// Grant "KYC" status to an account with respect to a token. +/// +/// The "KYC' property is named for the "Know Your Customer" requirements in +/// US federal regulations (FINRA 2090 and related US Code) that was subsequently +/// incorporated into laws and regulations for many worldwide jurisdictions. +/// The process requires a regulated financial entity to positively identify +/// customers and certain other entities. +/// +/// This transaction enables a token administrator to track whether KYC +/// requirements are met for a given account transacting in that token. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_grant_kyc.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_mint.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_mint.grpc.swift new file mode 100644 index 00000000..0d585357 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_mint.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Token Mint +/// Mint new tokens and deliver them to the token treasury. This is akin +/// to how a fiat treasury will mint new coinage for circulation. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_mint.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_pause.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_pause.grpc.swift new file mode 100644 index 00000000..7a6c355d --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_pause.grpc.swift @@ -0,0 +1,23 @@ +///* +/// # Token Pause +/// A transaction to "pause" all activity for a token. While a token is paused +/// it cannot be transferred between accounts by any transaction other than +/// `rejectToken`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_pause.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_reject.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_reject.grpc.swift new file mode 100644 index 00000000..7d569a16 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_reject.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Token Reject +/// Messages used to implement a transaction to reject a token type from an +/// account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_reject.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_revoke_kyc.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_revoke_kyc.grpc.swift new file mode 100644 index 00000000..a3c1d5fb --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_revoke_kyc.grpc.swift @@ -0,0 +1,30 @@ +///* +/// # Token Revoke KYC +/// Revoke "KYC" status from an account with respect to a token. +/// +/// The "KYC' property is named for the "Know Your Customer" requirements in +/// US federal regulations (FINRA 2090 and related US Code) that was subsequently +/// incorporated into laws and regulations for many worldwide jurisdictions. +/// The process requires a regulated financial entity to positively identify +/// customers and certain other entities. +/// +/// This transaction enables a token administrator to track whether KYC +/// requirements are met for a given account transacting in that token. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_revoke_kyc.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_service.grpc.swift index c28ea089..cf4df914 100644 --- a/Sources/HieroProtobufs/Generated/services/token_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/token_service.grpc.swift @@ -1,2712 +1,5705 @@ -// +///* +/// # Token Service +/// gRPC definitions for token service transactions. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/token_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// Transactions and queries for the Token Service -/// -/// Usage: instantiate `Proto_TokenServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_TokenServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? { get } - - func createToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func mintToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func burnToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func deleteToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func wipeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func freezeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func unfreezeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func grantKycToTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func revokeKycFromTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func associateTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func dissociateTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateTokenFeeSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func getTokenInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func getTokenNftInfo( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> UnaryCall - - func pauseToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func unpauseToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func updateNfts( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func rejectToken( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func airdropTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func cancelAirdrop( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func claimAirdrop( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.TokenService + +/// Namespace containing generated types for the "proto.TokenService" service. +public enum Proto_TokenService { + /// Service descriptor for the "proto.TokenService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "createToken" metadata. + public enum createToken { + /// Request type for "createToken". + public typealias Input = Proto_Transaction + /// Response type for "createToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "createToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "createToken" + ) + } + /// Namespace for "updateToken" metadata. + public enum updateToken { + /// Request type for "updateToken". + public typealias Input = Proto_Transaction + /// Response type for "updateToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "updateToken" + ) + } + /// Namespace for "mintToken" metadata. + public enum mintToken { + /// Request type for "mintToken". + public typealias Input = Proto_Transaction + /// Response type for "mintToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "mintToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "mintToken" + ) + } + /// Namespace for "burnToken" metadata. + public enum burnToken { + /// Request type for "burnToken". + public typealias Input = Proto_Transaction + /// Response type for "burnToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "burnToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "burnToken" + ) + } + /// Namespace for "deleteToken" metadata. + public enum deleteToken { + /// Request type for "deleteToken". + public typealias Input = Proto_Transaction + /// Response type for "deleteToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "deleteToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "deleteToken" + ) + } + /// Namespace for "wipeTokenAccount" metadata. + public enum wipeTokenAccount { + /// Request type for "wipeTokenAccount". + public typealias Input = Proto_Transaction + /// Response type for "wipeTokenAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "wipeTokenAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "wipeTokenAccount" + ) + } + /// Namespace for "freezeTokenAccount" metadata. + public enum freezeTokenAccount { + /// Request type for "freezeTokenAccount". + public typealias Input = Proto_Transaction + /// Response type for "freezeTokenAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "freezeTokenAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "freezeTokenAccount" + ) + } + /// Namespace for "unfreezeTokenAccount" metadata. + public enum unfreezeTokenAccount { + /// Request type for "unfreezeTokenAccount". + public typealias Input = Proto_Transaction + /// Response type for "unfreezeTokenAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "unfreezeTokenAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "unfreezeTokenAccount" + ) + } + /// Namespace for "grantKycToTokenAccount" metadata. + public enum grantKycToTokenAccount { + /// Request type for "grantKycToTokenAccount". + public typealias Input = Proto_Transaction + /// Response type for "grantKycToTokenAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "grantKycToTokenAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "grantKycToTokenAccount" + ) + } + /// Namespace for "revokeKycFromTokenAccount" metadata. + public enum revokeKycFromTokenAccount { + /// Request type for "revokeKycFromTokenAccount". + public typealias Input = Proto_Transaction + /// Response type for "revokeKycFromTokenAccount". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "revokeKycFromTokenAccount". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "revokeKycFromTokenAccount" + ) + } + /// Namespace for "associateTokens" metadata. + public enum associateTokens { + /// Request type for "associateTokens". + public typealias Input = Proto_Transaction + /// Response type for "associateTokens". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "associateTokens". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "associateTokens" + ) + } + /// Namespace for "dissociateTokens" metadata. + public enum dissociateTokens { + /// Request type for "dissociateTokens". + public typealias Input = Proto_Transaction + /// Response type for "dissociateTokens". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "dissociateTokens". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "dissociateTokens" + ) + } + /// Namespace for "updateTokenFeeSchedule" metadata. + public enum updateTokenFeeSchedule { + /// Request type for "updateTokenFeeSchedule". + public typealias Input = Proto_Transaction + /// Response type for "updateTokenFeeSchedule". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateTokenFeeSchedule". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "updateTokenFeeSchedule" + ) + } + /// Namespace for "getTokenInfo" metadata. + public enum getTokenInfo { + /// Request type for "getTokenInfo". + public typealias Input = Proto_Query + /// Response type for "getTokenInfo". + public typealias Output = Proto_Response + /// Descriptor for "getTokenInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "getTokenInfo" + ) + } + /// Namespace for "getTokenNftInfo" metadata. + public enum getTokenNftInfo { + /// Request type for "getTokenNftInfo". + public typealias Input = Proto_Query + /// Response type for "getTokenNftInfo". + public typealias Output = Proto_Response + /// Descriptor for "getTokenNftInfo". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "getTokenNftInfo" + ) + } + /// Namespace for "pauseToken" metadata. + public enum pauseToken { + /// Request type for "pauseToken". + public typealias Input = Proto_Transaction + /// Response type for "pauseToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "pauseToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "pauseToken" + ) + } + /// Namespace for "unpauseToken" metadata. + public enum unpauseToken { + /// Request type for "unpauseToken". + public typealias Input = Proto_Transaction + /// Response type for "unpauseToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "unpauseToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "unpauseToken" + ) + } + /// Namespace for "updateNfts" metadata. + public enum updateNfts { + /// Request type for "updateNfts". + public typealias Input = Proto_Transaction + /// Response type for "updateNfts". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "updateNfts". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "updateNfts" + ) + } + /// Namespace for "rejectToken" metadata. + public enum rejectToken { + /// Request type for "rejectToken". + public typealias Input = Proto_Transaction + /// Response type for "rejectToken". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "rejectToken". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "rejectToken" + ) + } + /// Namespace for "airdropTokens" metadata. + public enum airdropTokens { + /// Request type for "airdropTokens". + public typealias Input = Proto_Transaction + /// Response type for "airdropTokens". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "airdropTokens". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "airdropTokens" + ) + } + /// Namespace for "cancelAirdrop" metadata. + public enum cancelAirdrop { + /// Request type for "cancelAirdrop". + public typealias Input = Proto_Transaction + /// Response type for "cancelAirdrop". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "cancelAirdrop". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "cancelAirdrop" + ) + } + /// Namespace for "claimAirdrop" metadata. + public enum claimAirdrop { + /// Request type for "claimAirdrop". + public typealias Input = Proto_Transaction + /// Response type for "claimAirdrop". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "claimAirdrop". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService"), + method: "claimAirdrop" + ) + } + /// Descriptors for all methods in the "proto.TokenService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + createToken.descriptor, + updateToken.descriptor, + mintToken.descriptor, + burnToken.descriptor, + deleteToken.descriptor, + wipeTokenAccount.descriptor, + freezeTokenAccount.descriptor, + unfreezeTokenAccount.descriptor, + grantKycToTokenAccount.descriptor, + revokeKycFromTokenAccount.descriptor, + associateTokens.descriptor, + dissociateTokens.descriptor, + updateTokenFeeSchedule.descriptor, + getTokenInfo.descriptor, + getTokenNftInfo.descriptor, + pauseToken.descriptor, + unpauseToken.descriptor, + updateNfts.descriptor, + rejectToken.descriptor, + airdropTokens.descriptor, + cancelAirdrop.descriptor, + claimAirdrop.descriptor + ] + } } -extension Proto_TokenServiceClientProtocol { - public var serviceName: String { - return "proto.TokenService" - } - - ///* - /// Create a new token. - /// - /// - Parameters: - /// - request: Request to send to createToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func createToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.createToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateTokenInterceptors() ?? [] - ) - } - - ///* - /// Update a token. - /// - /// - Parameters: - /// - request: Request to send to updateToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTokenInterceptors() ?? [] - ) - } - - ///* - /// Mint one or more tokens to the treasury account. - ///

- /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - /// - /// - Parameters: - /// - request: Request to send to mintToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func mintToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.mintToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemintTokenInterceptors() ?? [] - ) - } - - ///* - /// Burn one or more tokens from the treasury account. - ///

- /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - /// - /// - Parameters: - /// - request: Request to send to burnToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func burnToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.burnToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeburnTokenInterceptors() ?? [] - ) - } - - ///* - /// Delete a token. - /// - /// - Parameters: - /// - request: Request to send to deleteToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func deleteToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.deleteToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteTokenInterceptors() ?? [] - ) - } - - ///* - /// Wipe one or more tokens from an identified Account. - ///

- /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - /// - /// - Parameters: - /// - request: Request to send to wipeTokenAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func wipeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.wipeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewipeTokenAccountInterceptors() ?? [] - ) - } - - ///* - /// Freeze the transfer of tokens to or from an identified Account. - /// - /// - Parameters: - /// - request: Request to send to freezeTokenAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func freezeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.freezeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makefreezeTokenAccountInterceptors() ?? [] - ) - } - - ///* - /// Unfreeze the transfer of tokens to or from an identified Account. - /// - /// - Parameters: - /// - request: Request to send to unfreezeTokenAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func unfreezeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.unfreezeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeunfreezeTokenAccountInterceptors() ?? [] - ) - } - - ///* - /// Assert that KYC requirements are met for a specific account with - /// respect to a specific token. - /// - /// - Parameters: - /// - request: Request to send to grantKycToTokenAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func grantKycToTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.grantKycToTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegrantKycToTokenAccountInterceptors() ?? [] - ) - } - - ///* - /// Assert that KYC requirements are _not_ met for a specific account with - /// respect to a specific token. - /// - /// - Parameters: - /// - request: Request to send to revokeKycFromTokenAccount. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func revokeKycFromTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.revokeKycFromTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerevokeKycFromTokenAccountInterceptors() ?? [] - ) - } - - ///* - /// Associate one or more tokens to an account. - /// - /// - Parameters: - /// - request: Request to send to associateTokens. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func associateTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.associateTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeassociateTokensInterceptors() ?? [] - ) - } - - ///* - /// Dissociate one or more tokens from an account. - /// - /// - Parameters: - /// - request: Request to send to dissociateTokens. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func dissociateTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.dissociateTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedissociateTokensInterceptors() ?? [] - ) - } - - ///* - /// Update the custom fee schedule for a token. - /// - /// - Parameters: - /// - request: Request to send to updateTokenFeeSchedule. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateTokenFeeSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateTokenFeeSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTokenFeeScheduleInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the detail characteristics for a token. - ///

- /// This query SHALL return information for the token type as a whole.
- /// This query SHALL NOT return information for individual tokens. - /// - /// - Parameters: - /// - request: Request to send to getTokenInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTokenInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.getTokenInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTokenInfoInterceptors() ?? [] - ) - } - - ///* - /// Retrieve the metadata for a specific non-fungible/unique token.
- /// The NFT to query is identified by token identifier and serial number. - ///

- /// This query SHALL return token metadata and, if an allowance is defined, - /// the designated "spender" account for the queried NFT. - /// - /// - Parameters: - /// - request: Request to send to getTokenNftInfo. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func getTokenNftInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.getTokenNftInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTokenNftInfoInterceptors() ?? [] - ) - } - - ///* - /// Pause a token. - /// - /// - Parameters: - /// - request: Request to send to pauseToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func pauseToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.pauseToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepauseTokenInterceptors() ?? [] - ) - } - - ///* - /// Unpause (resume) a token. - /// - /// - Parameters: - /// - request: Request to send to unpauseToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func unpauseToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.unpauseToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeunpauseTokenInterceptors() ?? [] - ) - } - - ///* - /// Update multiple non-fungible/unique tokens (NFTs) in a collection.
- /// The NFTs are identified by token identifier and one or more - /// serial numbers. - ///

- /// This transaction SHALL update NFT metadata only.
- /// This transaction MUST be signed by the token `metadata_key`. - /// - /// - Parameters: - /// - request: Request to send to updateNfts. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func updateNfts( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateNfts.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateNftsInterceptors() ?? [] - ) - } - - ///* - /// Reject one or more tokens. - ///

- /// This transaction SHALL transfer the full balance of one or more tokens - /// from the requesting account to the treasury for each token.
- /// This transfer SHALL NOT charge any custom fee or royalty defined for - /// the token(s) to be rejected.
- /// ### Effects on success - ///

    - ///
  • If the rejected token is fungible/common, the requesting account - /// SHALL have a balance of 0 for the rejected token.
    - /// The treasury balance SHALL increase by the amount that the - /// requesting account decreased.
  • - ///
  • If the rejected token is non-fungible/unique the requesting - /// account SHALL NOT hold the specific serialized token that - /// is rejected.
    - /// The treasury account SHALL hold each specific serialized token - /// that was rejected.
  • - /// - /// - /// - Parameters: - /// - request: Request to send to rejectToken. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func rejectToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.rejectToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerejectTokenInterceptors() ?? [] - ) - } - - ///* - /// Airdrop one or more tokens to one or more accounts. - ///

    - /// This transaction SHALL distribute tokens from the balance of one or - /// more sending account(s) to the balance of one or more - /// recipient accounts.
    - /// Accounts SHALL receive the tokens in one of four ways. - ///

      - ///
    • An account already associated to the token to be distributed - /// SHALL receive the airdropped tokens immediately to the - /// recipient account balance.
    • - ///
    • An account with available automatic association slots SHALL - /// be automatically associated to the token, and SHALL - /// immediately receive the airdropped tokens to the recipient - /// account balance.
    • - ///
    • An account with "receiver signature required" set SHALL have - /// a "Pending Airdrop" created and MUST claim that airdrop with - /// a `claimAirdrop` transaction.
    • - ///
    • An account with no available automatic association slots SHALL - /// have a "Pending Airdrop" created and MUST claim that airdrop - /// with a `claimAirdrop` transaction.
    • - ///
    - /// Any airdrop that completes immediately SHALL be irreversible.
    - /// Any airdrop that results in a "Pending Airdrop" MAY be canceled via - /// a `cancelAirdrop` transaction.
    - /// All transfer fees (including custom fees and royalties), as well as - /// the rent cost for the first auto-renewal period for any - /// automatic-association slot occupied by the airdropped tokens, - /// SHALL be charged to the account submitting this transaction. - /// - /// - Parameters: - /// - request: Request to send to airdropTokens. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func airdropTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.airdropTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeairdropTokensInterceptors() ?? [] - ) - } - - ///* - /// Cancel one or more pending airdrops. - ///

    - /// This transaction MUST be signed by _each_ account *sending* an - /// airdrop to be canceled. - /// - /// - Parameters: - /// - request: Request to send to cancelAirdrop. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func cancelAirdrop( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.cancelAirdrop.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecancelAirdropInterceptors() ?? [] - ) - } - - ///* - /// Claim one or more pending airdrops. - ///

    - /// This transaction MUST be signed by _each_ account **receiving** - /// an airdrop to be claimed.
    - /// If a "Sender" lacks sufficient balance to fulfill the airdrop at - /// the time the claim is made, that claim SHALL fail. - /// - /// - Parameters: - /// - request: Request to send to claimAirdrop. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func claimAirdrop( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.claimAirdrop.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeclaimAirdropInterceptors() ?? [] - ) - } +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.TokenService" service. + public static let proto_TokenService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.TokenService") } -@available(*, deprecated) -extension Proto_TokenServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_TokenServiceNIOClient") -public final class Proto_TokenServiceClient: Proto_TokenServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.TokenService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} +// MARK: proto.TokenService (server) + +extension Proto_TokenService { + /// Streaming variant of the service protocol for the "proto.TokenService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Token Service + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func createToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

    + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func mintToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

    + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func burnToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func deleteToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

    + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func wipeTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func freezeTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func unfreezeTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func grantKycToTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func revokeKycFromTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func associateTokens( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func dissociateTokens( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateTokenFeeSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

    + /// > This query SHALL return information for the token type as a whole.
    + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getTokenInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
    + /// > The NFT to query is identified by token identifier and serial number. + /// >

    + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Query` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_Response` messages. + func getTokenNftInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func pauseToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func unpauseToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
    + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

    + /// > This transaction SHALL update NFT metadata only.
    + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func updateNfts( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

    + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
    + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
    + /// > ### Effects on success + /// >

      + /// >
    • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
      + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
    • + /// >
    • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
      + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
    • + /// > + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func rejectToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

      + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
      + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

        + /// >
      • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
      • + /// >
      • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
      • + /// >
      • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
      • + /// >
      • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
      • + /// >
      + /// > Any airdrop that completes immediately SHALL be irreversible.
      + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
      + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func airdropTokens( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

      + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func cancelAirdrop( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

      + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
      + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func claimAirdrop( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } -public struct Proto_TokenServiceNIOClient: Proto_TokenServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.TokenService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + /// Service protocol for the "proto.TokenService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Token Service + public protocol ServiceProtocol: Proto_TokenService.StreamingServiceProtocol { + /// Handle the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func createToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

      + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func mintToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

      + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func burnToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func deleteToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

      + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func wipeTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func freezeTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func unfreezeTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func grantKycToTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func revokeKycFromTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func associateTokens( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func dissociateTokens( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateTokenFeeSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

      + /// > This query SHALL return information for the token type as a whole.
      + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getTokenInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
      + /// > The NFT to query is identified by token identifier and serial number. + /// >

      + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_Response` message. + func getTokenNftInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func pauseToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func unpauseToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
      + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

      + /// > This transaction SHALL update NFT metadata only.
      + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func updateNfts( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

      + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
      + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
      + /// > ### Effects on success + /// >

        + /// >
      • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
        + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
      • + /// >
      • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
        + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
      • + /// > + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func rejectToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

        + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
        + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

          + /// >
        • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
        • + /// >
        • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
        • + /// >
        • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
        • + /// >
        • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
        • + /// >
        + /// > Any airdrop that completes immediately SHALL be irreversible.
        + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
        + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func airdropTokens( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

        + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func cancelAirdrop( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

        + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
        + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func claimAirdrop( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } -///* -/// Transactions and queries for the Token Service -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_TokenServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? { get } - - func makeCreateTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeMintTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeBurnTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDeleteTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeWipeTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeFreezeTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUnfreezeTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGrantKycToTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeRevokeKycFromTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeAssociateTokensCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDissociateTokensCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateTokenFeeScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetTokenInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetTokenNftInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePauseTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUnpauseTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeUpdateNftsCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeRejectTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeAirdropTokensCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCancelAirdropCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeClaimAirdropCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall + /// Simple service protocol for the "proto.TokenService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Token Service + public protocol SimpleServiceProtocol: Proto_TokenService.ServiceProtocol { + /// Handle the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func createToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

        + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func mintToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

        + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func burnToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func deleteToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

        + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func wipeTokenAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func freezeTokenAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func unfreezeTokenAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func grantKycToTokenAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func revokeKycFromTokenAccount( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func associateTokens( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func dissociateTokens( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateTokenFeeSchedule( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

        + /// > This query SHALL return information for the token type as a whole.
        + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getTokenInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
        + /// > The NFT to query is identified by token identifier and serial number. + /// >

        + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - request: A `Proto_Query` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_Response` to respond with. + func getTokenNftInfo( + request: Proto_Query, + context: GRPCCore.ServerContext + ) async throws -> Proto_Response + + /// Handle the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func pauseToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func unpauseToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
        + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

        + /// > This transaction SHALL update NFT metadata only.
        + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func updateNfts( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

        + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
        + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
        + /// > ### Effects on success + /// >

          + /// >
        • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
          + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
        • + /// >
        • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
          + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
        • + /// > + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func rejectToken( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

          + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
          + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

            + /// >
          • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
          • + /// >
          • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
          • + /// >
          • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
          • + /// >
          • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
          • + /// >
          + /// > Any airdrop that completes immediately SHALL be irreversible.
          + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
          + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func airdropTokens( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

          + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func cancelAirdrop( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

          + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
          + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func claimAirdrop( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_TokenServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_TokenServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makeCreateTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.createToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateTokenInterceptors() ?? [] - ) - } - - public func makeUpdateTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTokenInterceptors() ?? [] - ) - } - - public func makeMintTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.mintToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemintTokenInterceptors() ?? [] - ) - } - - public func makeBurnTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.burnToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeburnTokenInterceptors() ?? [] - ) - } - - public func makeDeleteTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.deleteToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteTokenInterceptors() ?? [] - ) - } - - public func makeWipeTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.wipeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewipeTokenAccountInterceptors() ?? [] - ) - } - - public func makeFreezeTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.freezeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makefreezeTokenAccountInterceptors() ?? [] - ) - } - - public func makeUnfreezeTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.unfreezeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeunfreezeTokenAccountInterceptors() ?? [] - ) - } - - public func makeGrantKycToTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.grantKycToTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegrantKycToTokenAccountInterceptors() ?? [] - ) - } - - public func makeRevokeKycFromTokenAccountCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.revokeKycFromTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerevokeKycFromTokenAccountInterceptors() ?? [] - ) - } - - public func makeAssociateTokensCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.associateTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeassociateTokensInterceptors() ?? [] - ) - } - - public func makeDissociateTokensCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.dissociateTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedissociateTokensInterceptors() ?? [] - ) - } - - public func makeUpdateTokenFeeScheduleCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateTokenFeeSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTokenFeeScheduleInterceptors() ?? [] - ) - } - - public func makeGetTokenInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.getTokenInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTokenInfoInterceptors() ?? [] - ) - } - - public func makeGetTokenNftInfoCall( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.getTokenNftInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTokenNftInfoInterceptors() ?? [] - ) - } - - public func makePauseTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.pauseToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepauseTokenInterceptors() ?? [] - ) - } - - public func makeUnpauseTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.unpauseToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeunpauseTokenInterceptors() ?? [] - ) - } - - public func makeUpdateNftsCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateNfts.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateNftsInterceptors() ?? [] - ) - } - - public func makeRejectTokenCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.rejectToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerejectTokenInterceptors() ?? [] - ) - } - - public func makeAirdropTokensCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.airdropTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeairdropTokensInterceptors() ?? [] - ) - } - - public func makeCancelAirdropCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.cancelAirdrop.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecancelAirdropInterceptors() ?? [] - ) - } - - public func makeClaimAirdropCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.claimAirdrop.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeclaimAirdropInterceptors() ?? [] - ) - } +// Default implementation of 'registerMethods(with:)'. +extension Proto_TokenService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_TokenService.Method.createToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.createToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.updateToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.mintToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.mintToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.burnToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.burnToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.deleteToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.deleteToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.wipeTokenAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.wipeTokenAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.freezeTokenAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.freezeTokenAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.unfreezeTokenAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.unfreezeTokenAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.grantKycToTokenAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.grantKycToTokenAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.revokeKycFromTokenAccount.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.revokeKycFromTokenAccount( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.associateTokens.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.associateTokens( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.dissociateTokens.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.dissociateTokens( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.updateTokenFeeSchedule.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateTokenFeeSchedule( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.getTokenInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getTokenInfo( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.getTokenNftInfo.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.getTokenNftInfo( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.pauseToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.pauseToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.unpauseToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.unpauseToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.updateNfts.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.updateNfts( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.rejectToken.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.rejectToken( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.airdropTokens.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.airdropTokens( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.cancelAirdrop.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.cancelAirdrop( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_TokenService.Method.claimAirdrop.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.claimAirdrop( + request: request, + context: context + ) + } + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_TokenServiceAsyncClientProtocol { - public func createToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.createToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecreateTokenInterceptors() ?? [] - ) - } - - public func updateToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTokenInterceptors() ?? [] - ) - } - - public func mintToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.mintToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemintTokenInterceptors() ?? [] - ) - } - - public func burnToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.burnToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeburnTokenInterceptors() ?? [] - ) - } - - public func deleteToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.deleteToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedeleteTokenInterceptors() ?? [] - ) - } - - public func wipeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.wipeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewipeTokenAccountInterceptors() ?? [] - ) - } - - public func freezeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.freezeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makefreezeTokenAccountInterceptors() ?? [] - ) - } - - public func unfreezeTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.unfreezeTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeunfreezeTokenAccountInterceptors() ?? [] - ) - } - - public func grantKycToTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.grantKycToTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegrantKycToTokenAccountInterceptors() ?? [] - ) - } - - public func revokeKycFromTokenAccount( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.revokeKycFromTokenAccount.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerevokeKycFromTokenAccountInterceptors() ?? [] - ) - } - - public func associateTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.associateTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeassociateTokensInterceptors() ?? [] - ) - } - - public func dissociateTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.dissociateTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedissociateTokensInterceptors() ?? [] - ) - } - - public func updateTokenFeeSchedule( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateTokenFeeSchedule.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateTokenFeeScheduleInterceptors() ?? [] - ) - } - - public func getTokenInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.getTokenInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTokenInfoInterceptors() ?? [] - ) - } - - public func getTokenNftInfo( - _ request: Proto_Query, - callOptions: CallOptions? = nil - ) async throws -> Proto_Response { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.getTokenNftInfo.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetTokenNftInfoInterceptors() ?? [] - ) - } - - public func pauseToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.pauseToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepauseTokenInterceptors() ?? [] - ) - } - - public func unpauseToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.unpauseToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeunpauseTokenInterceptors() ?? [] - ) - } - - public func updateNfts( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.updateNfts.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeupdateNftsInterceptors() ?? [] - ) - } - - public func rejectToken( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.rejectToken.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerejectTokenInterceptors() ?? [] - ) - } - - public func airdropTokens( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.airdropTokens.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeairdropTokensInterceptors() ?? [] - ) - } - - public func cancelAirdrop( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.cancelAirdrop.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecancelAirdropInterceptors() ?? [] - ) - } - - public func claimAirdrop( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_TokenServiceClientMetadata.Methods.claimAirdrop.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeclaimAirdropInterceptors() ?? [] - ) - } -} +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_TokenService.ServiceProtocol { + public func createToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.createToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_TokenServiceAsyncClient: Proto_TokenServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_TokenServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} + public func updateToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func mintToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.mintToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func burnToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.burnToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func deleteToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.deleteToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func wipeTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.wipeTokenAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func freezeTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.freezeTokenAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func unfreezeTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.unfreezeTokenAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func grantKycToTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.grantKycToTokenAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func revokeKycFromTokenAccount( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.revokeKycFromTokenAccount( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func associateTokens( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.associateTokens( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } + + public func dissociateTokens( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.dissociateTokens( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } -public protocol Proto_TokenServiceClientInterceptorFactoryProtocol: Sendable { + public func updateTokenFeeSchedule( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateTokenFeeSchedule( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'createToken'. - func makecreateTokenInterceptors() -> [ClientInterceptor] + public func getTokenInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getTokenInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'updateToken'. - func makeupdateTokenInterceptors() -> [ClientInterceptor] + public func getTokenNftInfo( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.getTokenNftInfo( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'mintToken'. - func makemintTokenInterceptors() -> [ClientInterceptor] + public func pauseToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.pauseToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'burnToken'. - func makeburnTokenInterceptors() -> [ClientInterceptor] + public func unpauseToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.unpauseToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'deleteToken'. - func makedeleteTokenInterceptors() -> [ClientInterceptor] + public func updateNfts( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.updateNfts( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'wipeTokenAccount'. - func makewipeTokenAccountInterceptors() -> [ClientInterceptor] + public func rejectToken( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.rejectToken( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'freezeTokenAccount'. - func makefreezeTokenAccountInterceptors() -> [ClientInterceptor] + public func airdropTokens( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.airdropTokens( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'unfreezeTokenAccount'. - func makeunfreezeTokenAccountInterceptors() -> [ClientInterceptor] + public func cancelAirdrop( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.cancelAirdrop( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - /// - Returns: Interceptors to use when invoking 'grantKycToTokenAccount'. - func makegrantKycToTokenAccountInterceptors() -> [ClientInterceptor] + public func claimAirdrop( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.claimAirdrop( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } +} - /// - Returns: Interceptors to use when invoking 'revokeKycFromTokenAccount'. - func makerevokeKycFromTokenAccountInterceptors() -> [ClientInterceptor] +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_TokenService.SimpleServiceProtocol { + public func createToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.createToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'associateTokens'. - func makeassociateTokensInterceptors() -> [ClientInterceptor] + public func updateToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'dissociateTokens'. - func makedissociateTokensInterceptors() -> [ClientInterceptor] + public func mintToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.mintToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'updateTokenFeeSchedule'. - func makeupdateTokenFeeScheduleInterceptors() -> [ClientInterceptor] + public func burnToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.burnToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getTokenInfo'. - func makegetTokenInfoInterceptors() -> [ClientInterceptor] + public func deleteToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.deleteToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'getTokenNftInfo'. - func makegetTokenNftInfoInterceptors() -> [ClientInterceptor] + public func wipeTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.wipeTokenAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'pauseToken'. - func makepauseTokenInterceptors() -> [ClientInterceptor] + public func freezeTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.freezeTokenAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'unpauseToken'. - func makeunpauseTokenInterceptors() -> [ClientInterceptor] + public func unfreezeTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.unfreezeTokenAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'updateNfts'. - func makeupdateNftsInterceptors() -> [ClientInterceptor] + public func grantKycToTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.grantKycToTokenAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'rejectToken'. - func makerejectTokenInterceptors() -> [ClientInterceptor] + public func revokeKycFromTokenAccount( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.revokeKycFromTokenAccount( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'airdropTokens'. - func makeairdropTokensInterceptors() -> [ClientInterceptor] + public func associateTokens( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.associateTokens( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'cancelAirdrop'. - func makecancelAirdropInterceptors() -> [ClientInterceptor] + public func dissociateTokens( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.dissociateTokens( + request: request.message, + context: context + ), + metadata: [:] + ) + } - /// - Returns: Interceptors to use when invoking 'claimAirdrop'. - func makeclaimAirdropInterceptors() -> [ClientInterceptor] -} + public func updateTokenFeeSchedule( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateTokenFeeSchedule( + request: request.message, + context: context + ), + metadata: [:] + ) + } -public enum Proto_TokenServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "TokenService", - fullName: "proto.TokenService", - methods: [ - Proto_TokenServiceClientMetadata.Methods.createToken, - Proto_TokenServiceClientMetadata.Methods.updateToken, - Proto_TokenServiceClientMetadata.Methods.mintToken, - Proto_TokenServiceClientMetadata.Methods.burnToken, - Proto_TokenServiceClientMetadata.Methods.deleteToken, - Proto_TokenServiceClientMetadata.Methods.wipeTokenAccount, - Proto_TokenServiceClientMetadata.Methods.freezeTokenAccount, - Proto_TokenServiceClientMetadata.Methods.unfreezeTokenAccount, - Proto_TokenServiceClientMetadata.Methods.grantKycToTokenAccount, - Proto_TokenServiceClientMetadata.Methods.revokeKycFromTokenAccount, - Proto_TokenServiceClientMetadata.Methods.associateTokens, - Proto_TokenServiceClientMetadata.Methods.dissociateTokens, - Proto_TokenServiceClientMetadata.Methods.updateTokenFeeSchedule, - Proto_TokenServiceClientMetadata.Methods.getTokenInfo, - Proto_TokenServiceClientMetadata.Methods.getTokenNftInfo, - Proto_TokenServiceClientMetadata.Methods.pauseToken, - Proto_TokenServiceClientMetadata.Methods.unpauseToken, - Proto_TokenServiceClientMetadata.Methods.updateNfts, - Proto_TokenServiceClientMetadata.Methods.rejectToken, - Proto_TokenServiceClientMetadata.Methods.airdropTokens, - Proto_TokenServiceClientMetadata.Methods.cancelAirdrop, - Proto_TokenServiceClientMetadata.Methods.claimAirdrop, - ] - ) - - public enum Methods { - public static let createToken = GRPCMethodDescriptor( - name: "createToken", - path: "/proto.TokenService/createToken", - type: GRPCCallType.unary - ) - - public static let updateToken = GRPCMethodDescriptor( - name: "updateToken", - path: "/proto.TokenService/updateToken", - type: GRPCCallType.unary - ) - - public static let mintToken = GRPCMethodDescriptor( - name: "mintToken", - path: "/proto.TokenService/mintToken", - type: GRPCCallType.unary - ) - - public static let burnToken = GRPCMethodDescriptor( - name: "burnToken", - path: "/proto.TokenService/burnToken", - type: GRPCCallType.unary - ) - - public static let deleteToken = GRPCMethodDescriptor( - name: "deleteToken", - path: "/proto.TokenService/deleteToken", - type: GRPCCallType.unary - ) - - public static let wipeTokenAccount = GRPCMethodDescriptor( - name: "wipeTokenAccount", - path: "/proto.TokenService/wipeTokenAccount", - type: GRPCCallType.unary - ) - - public static let freezeTokenAccount = GRPCMethodDescriptor( - name: "freezeTokenAccount", - path: "/proto.TokenService/freezeTokenAccount", - type: GRPCCallType.unary - ) - - public static let unfreezeTokenAccount = GRPCMethodDescriptor( - name: "unfreezeTokenAccount", - path: "/proto.TokenService/unfreezeTokenAccount", - type: GRPCCallType.unary - ) - - public static let grantKycToTokenAccount = GRPCMethodDescriptor( - name: "grantKycToTokenAccount", - path: "/proto.TokenService/grantKycToTokenAccount", - type: GRPCCallType.unary - ) - - public static let revokeKycFromTokenAccount = GRPCMethodDescriptor( - name: "revokeKycFromTokenAccount", - path: "/proto.TokenService/revokeKycFromTokenAccount", - type: GRPCCallType.unary - ) - - public static let associateTokens = GRPCMethodDescriptor( - name: "associateTokens", - path: "/proto.TokenService/associateTokens", - type: GRPCCallType.unary - ) - - public static let dissociateTokens = GRPCMethodDescriptor( - name: "dissociateTokens", - path: "/proto.TokenService/dissociateTokens", - type: GRPCCallType.unary - ) - - public static let updateTokenFeeSchedule = GRPCMethodDescriptor( - name: "updateTokenFeeSchedule", - path: "/proto.TokenService/updateTokenFeeSchedule", - type: GRPCCallType.unary - ) - - public static let getTokenInfo = GRPCMethodDescriptor( - name: "getTokenInfo", - path: "/proto.TokenService/getTokenInfo", - type: GRPCCallType.unary - ) - - public static let getTokenNftInfo = GRPCMethodDescriptor( - name: "getTokenNftInfo", - path: "/proto.TokenService/getTokenNftInfo", - type: GRPCCallType.unary - ) - - public static let pauseToken = GRPCMethodDescriptor( - name: "pauseToken", - path: "/proto.TokenService/pauseToken", - type: GRPCCallType.unary - ) - - public static let unpauseToken = GRPCMethodDescriptor( - name: "unpauseToken", - path: "/proto.TokenService/unpauseToken", - type: GRPCCallType.unary - ) - - public static let updateNfts = GRPCMethodDescriptor( - name: "updateNfts", - path: "/proto.TokenService/updateNfts", - type: GRPCCallType.unary - ) - - public static let rejectToken = GRPCMethodDescriptor( - name: "rejectToken", - path: "/proto.TokenService/rejectToken", - type: GRPCCallType.unary - ) - - public static let airdropTokens = GRPCMethodDescriptor( - name: "airdropTokens", - path: "/proto.TokenService/airdropTokens", - type: GRPCCallType.unary - ) - - public static let cancelAirdrop = GRPCMethodDescriptor( - name: "cancelAirdrop", - path: "/proto.TokenService/cancelAirdrop", - type: GRPCCallType.unary - ) - - public static let claimAirdrop = GRPCMethodDescriptor( - name: "claimAirdrop", - path: "/proto.TokenService/claimAirdrop", - type: GRPCCallType.unary - ) - } -} + public func getTokenInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getTokenInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } -///* -/// Transactions and queries for the Token Service -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_TokenServiceProvider: CallHandlerProvider { - var interceptors: Proto_TokenServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new token. - func createToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Update a token. - func updateToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Mint one or more tokens to the treasury account. - ///

          - /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - func mintToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Burn one or more tokens from the treasury account. - ///

          - /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - func burnToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Delete a token. - func deleteToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Wipe one or more tokens from an identified Account. - ///

          - /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - func wipeTokenAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Freeze the transfer of tokens to or from an identified Account. - func freezeTokenAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Unfreeze the transfer of tokens to or from an identified Account. - func unfreezeTokenAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Assert that KYC requirements are met for a specific account with - /// respect to a specific token. - func grantKycToTokenAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Assert that KYC requirements are _not_ met for a specific account with - /// respect to a specific token. - func revokeKycFromTokenAccount(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Associate one or more tokens to an account. - func associateTokens(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Dissociate one or more tokens from an account. - func dissociateTokens(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Update the custom fee schedule for a token. - func updateTokenFeeSchedule(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the detail characteristics for a token. - ///

          - /// This query SHALL return information for the token type as a whole.
          - /// This query SHALL NOT return information for individual tokens. - func getTokenInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Retrieve the metadata for a specific non-fungible/unique token.
          - /// The NFT to query is identified by token identifier and serial number. - ///

          - /// This query SHALL return token metadata and, if an allowance is defined, - /// the designated "spender" account for the queried NFT. - func getTokenNftInfo(request: Proto_Query, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Pause a token. - func pauseToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Unpause (resume) a token. - func unpauseToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Update multiple non-fungible/unique tokens (NFTs) in a collection.
          - /// The NFTs are identified by token identifier and one or more - /// serial numbers. - ///

          - /// This transaction SHALL update NFT metadata only.
          - /// This transaction MUST be signed by the token `metadata_key`. - func updateNfts(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Reject one or more tokens. - ///

          - /// This transaction SHALL transfer the full balance of one or more tokens - /// from the requesting account to the treasury for each token.
          - /// This transfer SHALL NOT charge any custom fee or royalty defined for - /// the token(s) to be rejected.
          - /// ### Effects on success - ///

            - ///
          • If the rejected token is fungible/common, the requesting account - /// SHALL have a balance of 0 for the rejected token.
            - /// The treasury balance SHALL increase by the amount that the - /// requesting account decreased.
          • - ///
          • If the rejected token is non-fungible/unique the requesting - /// account SHALL NOT hold the specific serialized token that - /// is rejected.
            - /// The treasury account SHALL hold each specific serialized token - /// that was rejected.
          • - /// - func rejectToken(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Airdrop one or more tokens to one or more accounts. - ///

            - /// This transaction SHALL distribute tokens from the balance of one or - /// more sending account(s) to the balance of one or more - /// recipient accounts.
            - /// Accounts SHALL receive the tokens in one of four ways. - ///

              - ///
            • An account already associated to the token to be distributed - /// SHALL receive the airdropped tokens immediately to the - /// recipient account balance.
            • - ///
            • An account with available automatic association slots SHALL - /// be automatically associated to the token, and SHALL - /// immediately receive the airdropped tokens to the recipient - /// account balance.
            • - ///
            • An account with "receiver signature required" set SHALL have - /// a "Pending Airdrop" created and MUST claim that airdrop with - /// a `claimAirdrop` transaction.
            • - ///
            • An account with no available automatic association slots SHALL - /// have a "Pending Airdrop" created and MUST claim that airdrop - /// with a `claimAirdrop` transaction.
            • - ///
            - /// Any airdrop that completes immediately SHALL be irreversible.
            - /// Any airdrop that results in a "Pending Airdrop" MAY be canceled via - /// a `cancelAirdrop` transaction.
            - /// All transfer fees (including custom fees and royalties), as well as - /// the rent cost for the first auto-renewal period for any - /// automatic-association slot occupied by the airdropped tokens, - /// SHALL be charged to the account submitting this transaction. - func airdropTokens(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Cancel one or more pending airdrops. - ///

            - /// This transaction MUST be signed by _each_ account *sending* an - /// airdrop to be canceled. - func cancelAirdrop(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Claim one or more pending airdrops. - ///

            - /// This transaction MUST be signed by _each_ account **receiving** - /// an airdrop to be claimed.
            - /// If a "Sender" lacks sufficient balance to fulfill the airdrop at - /// the time the claim is made, that claim SHALL fail. - func claimAirdrop(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture -} + public func getTokenNftInfo( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.getTokenNftInfo( + request: request.message, + context: context + ), + metadata: [:] + ) + } -extension Proto_TokenServiceProvider { - public var serviceName: Substring { - return Proto_TokenServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateTokenInterceptors() ?? [], - userFunction: self.createToken(request:context:) - ) - - case "updateToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateTokenInterceptors() ?? [], - userFunction: self.updateToken(request:context:) - ) - - case "mintToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makemintTokenInterceptors() ?? [], - userFunction: self.mintToken(request:context:) - ) - - case "burnToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeburnTokenInterceptors() ?? [], - userFunction: self.burnToken(request:context:) - ) - - case "deleteToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteTokenInterceptors() ?? [], - userFunction: self.deleteToken(request:context:) - ) - - case "wipeTokenAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makewipeTokenAccountInterceptors() ?? [], - userFunction: self.wipeTokenAccount(request:context:) - ) - - case "freezeTokenAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makefreezeTokenAccountInterceptors() ?? [], - userFunction: self.freezeTokenAccount(request:context:) - ) - - case "unfreezeTokenAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeunfreezeTokenAccountInterceptors() ?? [], - userFunction: self.unfreezeTokenAccount(request:context:) - ) - - case "grantKycToTokenAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegrantKycToTokenAccountInterceptors() ?? [], - userFunction: self.grantKycToTokenAccount(request:context:) - ) - - case "revokeKycFromTokenAccount": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerevokeKycFromTokenAccountInterceptors() ?? [], - userFunction: self.revokeKycFromTokenAccount(request:context:) - ) - - case "associateTokens": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeassociateTokensInterceptors() ?? [], - userFunction: self.associateTokens(request:context:) - ) - - case "dissociateTokens": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedissociateTokensInterceptors() ?? [], - userFunction: self.dissociateTokens(request:context:) - ) - - case "updateTokenFeeSchedule": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateTokenFeeScheduleInterceptors() ?? [], - userFunction: self.updateTokenFeeSchedule(request:context:) - ) - - case "getTokenInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTokenInfoInterceptors() ?? [], - userFunction: self.getTokenInfo(request:context:) - ) - - case "getTokenNftInfo": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTokenNftInfoInterceptors() ?? [], - userFunction: self.getTokenNftInfo(request:context:) - ) - - case "pauseToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepauseTokenInterceptors() ?? [], - userFunction: self.pauseToken(request:context:) - ) - - case "unpauseToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeunpauseTokenInterceptors() ?? [], - userFunction: self.unpauseToken(request:context:) - ) - - case "updateNfts": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateNftsInterceptors() ?? [], - userFunction: self.updateNfts(request:context:) - ) - - case "rejectToken": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerejectTokenInterceptors() ?? [], - userFunction: self.rejectToken(request:context:) - ) - - case "airdropTokens": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeairdropTokensInterceptors() ?? [], - userFunction: self.airdropTokens(request:context:) - ) - - case "cancelAirdrop": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecancelAirdropInterceptors() ?? [], - userFunction: self.cancelAirdrop(request:context:) - ) - - case "claimAirdrop": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeclaimAirdropInterceptors() ?? [], - userFunction: self.claimAirdrop(request:context:) - ) - - default: - return nil - } - } -} + public func pauseToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.pauseToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } -///* -/// Transactions and queries for the Token Service -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_TokenServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_TokenServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Create a new token. - func createToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Update a token. - func updateToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Mint one or more tokens to the treasury account. - ///

            - /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - func mintToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Burn one or more tokens from the treasury account. - ///

            - /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - func burnToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Delete a token. - func deleteToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Wipe one or more tokens from an identified Account. - ///

            - /// This MAY specify a quantity of fungible/common tokens or - /// a list of specific non-fungible/unique tokes, but - /// MUST NOT specify both. - func wipeTokenAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Freeze the transfer of tokens to or from an identified Account. - func freezeTokenAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Unfreeze the transfer of tokens to or from an identified Account. - func unfreezeTokenAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Assert that KYC requirements are met for a specific account with - /// respect to a specific token. - func grantKycToTokenAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Assert that KYC requirements are _not_ met for a specific account with - /// respect to a specific token. - func revokeKycFromTokenAccount( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Associate one or more tokens to an account. - func associateTokens( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Dissociate one or more tokens from an account. - func dissociateTokens( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Update the custom fee schedule for a token. - func updateTokenFeeSchedule( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Retrieve the detail characteristics for a token. - ///

            - /// This query SHALL return information for the token type as a whole.
            - /// This query SHALL NOT return information for individual tokens. - func getTokenInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Retrieve the metadata for a specific non-fungible/unique token.
            - /// The NFT to query is identified by token identifier and serial number. - ///

            - /// This query SHALL return token metadata and, if an allowance is defined, - /// the designated "spender" account for the queried NFT. - func getTokenNftInfo( - request: Proto_Query, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_Response - - ///* - /// Pause a token. - func pauseToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Unpause (resume) a token. - func unpauseToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Update multiple non-fungible/unique tokens (NFTs) in a collection.
            - /// The NFTs are identified by token identifier and one or more - /// serial numbers. - ///

            - /// This transaction SHALL update NFT metadata only.
            - /// This transaction MUST be signed by the token `metadata_key`. - func updateNfts( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Reject one or more tokens. - ///

            - /// This transaction SHALL transfer the full balance of one or more tokens - /// from the requesting account to the treasury for each token.
            - /// This transfer SHALL NOT charge any custom fee or royalty defined for - /// the token(s) to be rejected.
            - /// ### Effects on success - ///

              - ///
            • If the rejected token is fungible/common, the requesting account - /// SHALL have a balance of 0 for the rejected token.
              - /// The treasury balance SHALL increase by the amount that the - /// requesting account decreased.
            • - ///
            • If the rejected token is non-fungible/unique the requesting - /// account SHALL NOT hold the specific serialized token that - /// is rejected.
              - /// The treasury account SHALL hold each specific serialized token - /// that was rejected.
            • - /// - func rejectToken( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Airdrop one or more tokens to one or more accounts. - ///

              - /// This transaction SHALL distribute tokens from the balance of one or - /// more sending account(s) to the balance of one or more - /// recipient accounts.
              - /// Accounts SHALL receive the tokens in one of four ways. - ///

                - ///
              • An account already associated to the token to be distributed - /// SHALL receive the airdropped tokens immediately to the - /// recipient account balance.
              • - ///
              • An account with available automatic association slots SHALL - /// be automatically associated to the token, and SHALL - /// immediately receive the airdropped tokens to the recipient - /// account balance.
              • - ///
              • An account with "receiver signature required" set SHALL have - /// a "Pending Airdrop" created and MUST claim that airdrop with - /// a `claimAirdrop` transaction.
              • - ///
              • An account with no available automatic association slots SHALL - /// have a "Pending Airdrop" created and MUST claim that airdrop - /// with a `claimAirdrop` transaction.
              • - ///
              - /// Any airdrop that completes immediately SHALL be irreversible.
              - /// Any airdrop that results in a "Pending Airdrop" MAY be canceled via - /// a `cancelAirdrop` transaction.
              - /// All transfer fees (including custom fees and royalties), as well as - /// the rent cost for the first auto-renewal period for any - /// automatic-association slot occupied by the airdropped tokens, - /// SHALL be charged to the account submitting this transaction. - func airdropTokens( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Cancel one or more pending airdrops. - ///

              - /// This transaction MUST be signed by _each_ account *sending* an - /// airdrop to be canceled. - func cancelAirdrop( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse - - ///* - /// Claim one or more pending airdrops. - ///

              - /// This transaction MUST be signed by _each_ account **receiving** - /// an airdrop to be claimed.
              - /// If a "Sender" lacks sufficient balance to fulfill the airdrop at - /// the time the claim is made, that claim SHALL fail. - func claimAirdrop( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse -} + public func unpauseToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.unpauseToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func updateNfts( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.updateNfts( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func rejectToken( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.rejectToken( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func airdropTokens( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.airdropTokens( + request: request.message, + context: context + ), + metadata: [:] + ) + } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_TokenServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_TokenServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_TokenServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_TokenServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "createToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecreateTokenInterceptors() ?? [], - wrapping: { try await self.createToken(request: $0, context: $1) } - ) - - case "updateToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateTokenInterceptors() ?? [], - wrapping: { try await self.updateToken(request: $0, context: $1) } - ) - - case "mintToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makemintTokenInterceptors() ?? [], - wrapping: { try await self.mintToken(request: $0, context: $1) } - ) - - case "burnToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeburnTokenInterceptors() ?? [], - wrapping: { try await self.burnToken(request: $0, context: $1) } - ) - - case "deleteToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedeleteTokenInterceptors() ?? [], - wrapping: { try await self.deleteToken(request: $0, context: $1) } - ) - - case "wipeTokenAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makewipeTokenAccountInterceptors() ?? [], - wrapping: { try await self.wipeTokenAccount(request: $0, context: $1) } - ) - - case "freezeTokenAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makefreezeTokenAccountInterceptors() ?? [], - wrapping: { try await self.freezeTokenAccount(request: $0, context: $1) } - ) - - case "unfreezeTokenAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeunfreezeTokenAccountInterceptors() ?? [], - wrapping: { try await self.unfreezeTokenAccount(request: $0, context: $1) } - ) - - case "grantKycToTokenAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegrantKycToTokenAccountInterceptors() ?? [], - wrapping: { try await self.grantKycToTokenAccount(request: $0, context: $1) } - ) - - case "revokeKycFromTokenAccount": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerevokeKycFromTokenAccountInterceptors() ?? [], - wrapping: { try await self.revokeKycFromTokenAccount(request: $0, context: $1) } - ) - - case "associateTokens": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeassociateTokensInterceptors() ?? [], - wrapping: { try await self.associateTokens(request: $0, context: $1) } - ) - - case "dissociateTokens": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedissociateTokensInterceptors() ?? [], - wrapping: { try await self.dissociateTokens(request: $0, context: $1) } - ) - - case "updateTokenFeeSchedule": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateTokenFeeScheduleInterceptors() ?? [], - wrapping: { try await self.updateTokenFeeSchedule(request: $0, context: $1) } - ) - - case "getTokenInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTokenInfoInterceptors() ?? [], - wrapping: { try await self.getTokenInfo(request: $0, context: $1) } - ) - - case "getTokenNftInfo": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetTokenNftInfoInterceptors() ?? [], - wrapping: { try await self.getTokenNftInfo(request: $0, context: $1) } - ) - - case "pauseToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepauseTokenInterceptors() ?? [], - wrapping: { try await self.pauseToken(request: $0, context: $1) } - ) - - case "unpauseToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeunpauseTokenInterceptors() ?? [], - wrapping: { try await self.unpauseToken(request: $0, context: $1) } - ) - - case "updateNfts": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeupdateNftsInterceptors() ?? [], - wrapping: { try await self.updateNfts(request: $0, context: $1) } - ) - - case "rejectToken": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerejectTokenInterceptors() ?? [], - wrapping: { try await self.rejectToken(request: $0, context: $1) } - ) - - case "airdropTokens": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeairdropTokensInterceptors() ?? [], - wrapping: { try await self.airdropTokens(request: $0, context: $1) } - ) - - case "cancelAirdrop": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecancelAirdropInterceptors() ?? [], - wrapping: { try await self.cancelAirdrop(request: $0, context: $1) } - ) - - case "claimAirdrop": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeclaimAirdropInterceptors() ?? [], - wrapping: { try await self.claimAirdrop(request: $0, context: $1) } - ) - - default: - return nil - } - } + public func cancelAirdrop( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.cancelAirdrop( + request: request.message, + context: context + ), + metadata: [:] + ) + } + + public func claimAirdrop( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.claimAirdrop( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -public protocol Proto_TokenServiceServerInterceptorFactoryProtocol: Sendable { +// MARK: proto.TokenService (client) + +extension Proto_TokenService { + /// Generated client protocol for the "proto.TokenService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Token Service + public protocol ClientProtocol: Sendable { + /// Call the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func createToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

              + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func mintToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

              + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func burnToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func deleteToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

              + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func wipeTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func freezeTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func unfreezeTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func grantKycToTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func revokeKycFromTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func associateTokens( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func dissociateTokens( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateTokenFeeSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

              + /// > This query SHALL return information for the token type as a whole.
              + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getTokenInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
              + /// > The NFT to query is identified by token identifier and serial number. + /// >

              + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func getTokenNftInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func pauseToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func unpauseToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
              + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

              + /// > This transaction SHALL update NFT metadata only.
              + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func updateNfts( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

              + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
              + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
              + /// > ### Effects on success + /// >

                + /// >
              • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
                + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
              • + /// >
              • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
                + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
              • + /// > + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func rejectToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

                + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
                + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

                  + /// >
                • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
                • + /// >
                • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
                • + /// >
                • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
                • + /// >
                • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
                • + /// >
                + /// > Any airdrop that completes immediately SHALL be irreversible.
                + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
                + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func airdropTokens( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

                + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func cancelAirdrop( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

                + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
                + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func claimAirdrop( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } - /// - Returns: Interceptors to use when handling 'createToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makecreateTokenInterceptors() -> [ServerInterceptor] + /// Generated client for the "proto.TokenService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Transactions and queries for the Token Service + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.createToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.updateToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

                + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func mintToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.mintToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

                + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func burnToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.burnToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.deleteToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

                + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func wipeTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.wipeTokenAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func freezeTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.freezeTokenAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func unfreezeTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.unfreezeTokenAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func grantKycToTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.grantKycToTokenAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func revokeKycFromTokenAccount( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.revokeKycFromTokenAccount.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func associateTokens( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.associateTokens.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func dissociateTokens( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.dissociateTokens.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateTokenFeeSchedule( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.updateTokenFeeSchedule.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

                + /// > This query SHALL return information for the token type as a whole.
                + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTokenInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.getTokenInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
                + /// > The NFT to query is identified by token identifier and serial number. + /// >

                + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - serializer: A serializer for `Proto_Query` messages. + /// - deserializer: A deserializer for `Proto_Response` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTokenNftInfo( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.getTokenNftInfo.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func pauseToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.pauseToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func unpauseToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.unpauseToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
                + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

                + /// > This transaction SHALL update NFT metadata only.
                + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateNfts( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.updateNfts.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

                + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
                + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
                + /// > ### Effects on success + /// >

                  + /// >
                • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
                  + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
                • + /// >
                • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
                  + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
                • + /// > + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func rejectToken( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.rejectToken.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

                  + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
                  + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

                    + /// >
                  • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
                  • + /// >
                  • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
                  • + /// >
                  • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
                  • + /// >
                  • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
                  • + /// >
                  + /// > Any airdrop that completes immediately SHALL be irreversible.
                  + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
                  + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func airdropTokens( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.airdropTokens.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

                  + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cancelAirdrop( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.cancelAirdrop.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

                  + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
                  + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func claimAirdrop( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_TokenService.Method.claimAirdrop.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + } +} - /// - Returns: Interceptors to use when handling 'updateToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateTokenInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_TokenService.ClientProtocol { + /// Call the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.createToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'mintToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makemintTokenInterceptors() -> [ServerInterceptor] + /// Call the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'burnToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makeburnTokenInterceptors() -> [ServerInterceptor] + /// Call the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

                  + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func mintToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.mintToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'deleteToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makedeleteTokenInterceptors() -> [ServerInterceptor] + /// Call the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

                  + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func burnToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.burnToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'wipeTokenAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makewipeTokenAccountInterceptors() -> [ServerInterceptor] + /// Call the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.deleteToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'freezeTokenAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makefreezeTokenAccountInterceptors() -> [ServerInterceptor] + /// Call the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

                  + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func wipeTokenAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.wipeTokenAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'unfreezeTokenAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makeunfreezeTokenAccountInterceptors() -> [ServerInterceptor] + /// Call the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func freezeTokenAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.freezeTokenAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'grantKycToTokenAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makegrantKycToTokenAccountInterceptors() -> [ServerInterceptor] + /// Call the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func unfreezeTokenAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.unfreezeTokenAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'revokeKycFromTokenAccount'. - /// Defaults to calling `self.makeInterceptors()`. - func makerevokeKycFromTokenAccountInterceptors() -> [ServerInterceptor] + /// Call the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func grantKycToTokenAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.grantKycToTokenAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'associateTokens'. - /// Defaults to calling `self.makeInterceptors()`. - func makeassociateTokensInterceptors() -> [ServerInterceptor] + /// Call the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func revokeKycFromTokenAccount( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.revokeKycFromTokenAccount( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'dissociateTokens'. - /// Defaults to calling `self.makeInterceptors()`. - func makedissociateTokensInterceptors() -> [ServerInterceptor] + /// Call the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func associateTokens( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.associateTokens( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'updateTokenFeeSchedule'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateTokenFeeScheduleInterceptors() -> [ServerInterceptor] + /// Call the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func dissociateTokens( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.dissociateTokens( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getTokenInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetTokenInfoInterceptors() -> [ServerInterceptor] + /// Call the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateTokenFeeSchedule( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateTokenFeeSchedule( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'getTokenNftInfo'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetTokenNftInfoInterceptors() -> [ServerInterceptor] + /// Call the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

                  + /// > This query SHALL return information for the token type as a whole.
                  + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTokenInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getTokenInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'pauseToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makepauseTokenInterceptors() -> [ServerInterceptor] + /// Call the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
                  + /// > The NFT to query is identified by token identifier and serial number. + /// >

                  + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Query` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTokenNftInfo( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.getTokenNftInfo( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'unpauseToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makeunpauseTokenInterceptors() -> [ServerInterceptor] + /// Call the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func pauseToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.pauseToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'updateNfts'. - /// Defaults to calling `self.makeInterceptors()`. - func makeupdateNftsInterceptors() -> [ServerInterceptor] + /// Call the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func unpauseToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.unpauseToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'rejectToken'. - /// Defaults to calling `self.makeInterceptors()`. - func makerejectTokenInterceptors() -> [ServerInterceptor] + /// Call the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
                  + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

                  + /// > This transaction SHALL update NFT metadata only.
                  + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateNfts( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.updateNfts( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'airdropTokens'. - /// Defaults to calling `self.makeInterceptors()`. - func makeairdropTokensInterceptors() -> [ServerInterceptor] + /// Call the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

                  + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
                  + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
                  + /// > ### Effects on success + /// >

                    + /// >
                  • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
                    + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
                  • + /// >
                  • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
                    + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
                  • + /// > + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func rejectToken( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.rejectToken( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'cancelAirdrop'. - /// Defaults to calling `self.makeInterceptors()`. - func makecancelAirdropInterceptors() -> [ServerInterceptor] + /// Call the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

                    + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
                    + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

                      + /// >
                    • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
                    • + /// >
                    • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
                    • + /// >
                    • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
                    • + /// >
                    • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
                    • + /// >
                    + /// > Any airdrop that completes immediately SHALL be irreversible.
                    + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
                    + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func airdropTokens( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.airdropTokens( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'claimAirdrop'. - /// Defaults to calling `self.makeInterceptors()`. - func makeclaimAirdropInterceptors() -> [ServerInterceptor] -} + /// Call the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

                    + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cancelAirdrop( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.cancelAirdrop( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } -public enum Proto_TokenServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "TokenService", - fullName: "proto.TokenService", - methods: [ - Proto_TokenServiceServerMetadata.Methods.createToken, - Proto_TokenServiceServerMetadata.Methods.updateToken, - Proto_TokenServiceServerMetadata.Methods.mintToken, - Proto_TokenServiceServerMetadata.Methods.burnToken, - Proto_TokenServiceServerMetadata.Methods.deleteToken, - Proto_TokenServiceServerMetadata.Methods.wipeTokenAccount, - Proto_TokenServiceServerMetadata.Methods.freezeTokenAccount, - Proto_TokenServiceServerMetadata.Methods.unfreezeTokenAccount, - Proto_TokenServiceServerMetadata.Methods.grantKycToTokenAccount, - Proto_TokenServiceServerMetadata.Methods.revokeKycFromTokenAccount, - Proto_TokenServiceServerMetadata.Methods.associateTokens, - Proto_TokenServiceServerMetadata.Methods.dissociateTokens, - Proto_TokenServiceServerMetadata.Methods.updateTokenFeeSchedule, - Proto_TokenServiceServerMetadata.Methods.getTokenInfo, - Proto_TokenServiceServerMetadata.Methods.getTokenNftInfo, - Proto_TokenServiceServerMetadata.Methods.pauseToken, - Proto_TokenServiceServerMetadata.Methods.unpauseToken, - Proto_TokenServiceServerMetadata.Methods.updateNfts, - Proto_TokenServiceServerMetadata.Methods.rejectToken, - Proto_TokenServiceServerMetadata.Methods.airdropTokens, - Proto_TokenServiceServerMetadata.Methods.cancelAirdrop, - Proto_TokenServiceServerMetadata.Methods.claimAirdrop, - ] - ) - - public enum Methods { - public static let createToken = GRPCMethodDescriptor( - name: "createToken", - path: "/proto.TokenService/createToken", - type: GRPCCallType.unary - ) - - public static let updateToken = GRPCMethodDescriptor( - name: "updateToken", - path: "/proto.TokenService/updateToken", - type: GRPCCallType.unary - ) - - public static let mintToken = GRPCMethodDescriptor( - name: "mintToken", - path: "/proto.TokenService/mintToken", - type: GRPCCallType.unary - ) - - public static let burnToken = GRPCMethodDescriptor( - name: "burnToken", - path: "/proto.TokenService/burnToken", - type: GRPCCallType.unary - ) - - public static let deleteToken = GRPCMethodDescriptor( - name: "deleteToken", - path: "/proto.TokenService/deleteToken", - type: GRPCCallType.unary - ) - - public static let wipeTokenAccount = GRPCMethodDescriptor( - name: "wipeTokenAccount", - path: "/proto.TokenService/wipeTokenAccount", - type: GRPCCallType.unary - ) - - public static let freezeTokenAccount = GRPCMethodDescriptor( - name: "freezeTokenAccount", - path: "/proto.TokenService/freezeTokenAccount", - type: GRPCCallType.unary - ) - - public static let unfreezeTokenAccount = GRPCMethodDescriptor( - name: "unfreezeTokenAccount", - path: "/proto.TokenService/unfreezeTokenAccount", - type: GRPCCallType.unary - ) - - public static let grantKycToTokenAccount = GRPCMethodDescriptor( - name: "grantKycToTokenAccount", - path: "/proto.TokenService/grantKycToTokenAccount", - type: GRPCCallType.unary - ) - - public static let revokeKycFromTokenAccount = GRPCMethodDescriptor( - name: "revokeKycFromTokenAccount", - path: "/proto.TokenService/revokeKycFromTokenAccount", - type: GRPCCallType.unary - ) - - public static let associateTokens = GRPCMethodDescriptor( - name: "associateTokens", - path: "/proto.TokenService/associateTokens", - type: GRPCCallType.unary - ) - - public static let dissociateTokens = GRPCMethodDescriptor( - name: "dissociateTokens", - path: "/proto.TokenService/dissociateTokens", - type: GRPCCallType.unary - ) - - public static let updateTokenFeeSchedule = GRPCMethodDescriptor( - name: "updateTokenFeeSchedule", - path: "/proto.TokenService/updateTokenFeeSchedule", - type: GRPCCallType.unary - ) - - public static let getTokenInfo = GRPCMethodDescriptor( - name: "getTokenInfo", - path: "/proto.TokenService/getTokenInfo", - type: GRPCCallType.unary - ) - - public static let getTokenNftInfo = GRPCMethodDescriptor( - name: "getTokenNftInfo", - path: "/proto.TokenService/getTokenNftInfo", - type: GRPCCallType.unary - ) - - public static let pauseToken = GRPCMethodDescriptor( - name: "pauseToken", - path: "/proto.TokenService/pauseToken", - type: GRPCCallType.unary - ) - - public static let unpauseToken = GRPCMethodDescriptor( - name: "unpauseToken", - path: "/proto.TokenService/unpauseToken", - type: GRPCCallType.unary - ) - - public static let updateNfts = GRPCMethodDescriptor( - name: "updateNfts", - path: "/proto.TokenService/updateNfts", - type: GRPCCallType.unary - ) - - public static let rejectToken = GRPCMethodDescriptor( - name: "rejectToken", - path: "/proto.TokenService/rejectToken", - type: GRPCCallType.unary - ) - - public static let airdropTokens = GRPCMethodDescriptor( - name: "airdropTokens", - path: "/proto.TokenService/airdropTokens", - type: GRPCCallType.unary - ) - - public static let cancelAirdrop = GRPCMethodDescriptor( - name: "cancelAirdrop", - path: "/proto.TokenService/cancelAirdrop", - type: GRPCCallType.unary - ) - - public static let claimAirdrop = GRPCMethodDescriptor( - name: "claimAirdrop", - path: "/proto.TokenService/claimAirdrop", - type: GRPCCallType.unary - ) - } + /// Call the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

                    + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
                    + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func claimAirdrop( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.claimAirdrop( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } + +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_TokenService.ClientProtocol { + /// Call the "createToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Create a new token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func createToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.createToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update a token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "mintToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Mint one or more tokens to the treasury account. + /// >

                    + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func mintToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.mintToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "burnToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Burn one or more tokens from the treasury account. + /// >

                    + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func burnToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.burnToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "deleteToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Delete a token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func deleteToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.deleteToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "wipeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Wipe one or more tokens from an identified Account. + /// >

                    + /// > This MAY specify a quantity of fungible/common tokens or + /// > a list of specific non-fungible/unique tokes, but + /// > MUST NOT specify both. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func wipeTokenAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.wipeTokenAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "freezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Freeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func freezeTokenAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.freezeTokenAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "unfreezeTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unfreeze the transfer of tokens to or from an identified Account. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func unfreezeTokenAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.unfreezeTokenAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "grantKycToTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func grantKycToTokenAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.grantKycToTokenAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "revokeKycFromTokenAccount" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Assert that KYC requirements are _not_ met for a specific account with + /// > respect to a specific token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func revokeKycFromTokenAccount( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.revokeKycFromTokenAccount( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "associateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Associate one or more tokens to an account. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func associateTokens( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.associateTokens( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "dissociateTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Dissociate one or more tokens from an account. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func dissociateTokens( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.dissociateTokens( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateTokenFeeSchedule" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update the custom fee schedule for a token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateTokenFeeSchedule( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateTokenFeeSchedule( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTokenInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the detail characteristics for a token. + /// >

                    + /// > This query SHALL return information for the token type as a whole.
                    + /// > This query SHALL NOT return information for individual tokens. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTokenInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getTokenInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "getTokenNftInfo" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Retrieve the metadata for a specific non-fungible/unique token.
                    + /// > The NFT to query is identified by token identifier and serial number. + /// >

                    + /// > This query SHALL return token metadata and, if an allowance is defined, + /// > the designated "spender" account for the queried NFT. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func getTokenNftInfo( + _ message: Proto_Query, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.getTokenNftInfo( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "pauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Pause a token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func pauseToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.pauseToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "unpauseToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Unpause (resume) a token. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func unpauseToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.unpauseToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "updateNfts" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Update multiple non-fungible/unique tokens (NFTs) in a collection.
                    + /// > The NFTs are identified by token identifier and one or more + /// > serial numbers. + /// >

                    + /// > This transaction SHALL update NFT metadata only.
                    + /// > This transaction MUST be signed by the token `metadata_key`. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func updateNfts( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.updateNfts( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "rejectToken" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Reject one or more tokens. + /// >

                    + /// > This transaction SHALL transfer the full balance of one or more tokens + /// > from the requesting account to the treasury for each token.
                    + /// > This transfer SHALL NOT charge any custom fee or royalty defined for + /// > the token(s) to be rejected.
                    + /// > ### Effects on success + /// >

                      + /// >
                    • If the rejected token is fungible/common, the requesting account + /// > SHALL have a balance of 0 for the rejected token.
                      + /// > The treasury balance SHALL increase by the amount that the + /// > requesting account decreased.
                    • + /// >
                    • If the rejected token is non-fungible/unique the requesting + /// > account SHALL NOT hold the specific serialized token that + /// > is rejected.
                      + /// > The treasury account SHALL hold each specific serialized token + /// > that was rejected.
                    • + /// > + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func rejectToken( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.rejectToken( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "airdropTokens" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Airdrop one or more tokens to one or more accounts. + /// >

                      + /// > This transaction SHALL distribute tokens from the balance of one or + /// > more sending account(s) to the balance of one or more + /// > recipient accounts.
                      + /// > Accounts SHALL receive the tokens in one of four ways. + /// >

                        + /// >
                      • An account already associated to the token to be distributed + /// > SHALL receive the airdropped tokens immediately to the + /// > recipient account balance.
                      • + /// >
                      • An account with available automatic association slots SHALL + /// > be automatically associated to the token, and SHALL + /// > immediately receive the airdropped tokens to the recipient + /// > account balance.
                      • + /// >
                      • An account with "receiver signature required" set SHALL have + /// > a "Pending Airdrop" created and MUST claim that airdrop with + /// > a `claimAirdrop` transaction.
                      • + /// >
                      • An account with no available automatic association slots SHALL + /// > have a "Pending Airdrop" created and MUST claim that airdrop + /// > with a `claimAirdrop` transaction.
                      • + /// >
                      + /// > Any airdrop that completes immediately SHALL be irreversible.
                      + /// > Any airdrop that results in a "Pending Airdrop" MAY be canceled via + /// > a `cancelAirdrop` transaction.
                      + /// > All transfer fees (including custom fees and royalties), as well as + /// > the rent cost for the first auto-renewal period for any + /// > automatic-association slot occupied by the airdropped tokens, + /// > SHALL be charged to the account submitting this transaction. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func airdropTokens( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.airdropTokens( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "cancelAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Cancel one or more pending airdrops. + /// >

                      + /// > This transaction MUST be signed by _each_ account *sending* an + /// > airdrop to be canceled. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func cancelAirdrop( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.cancelAirdrop( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "claimAirdrop" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Claim one or more pending airdrops. + /// >

                      + /// > This transaction MUST be signed by _each_ account **receiving** + /// > an airdrop to be claimed.
                      + /// > If a "Sender" lacks sufficient balance to fulfill the airdrop at + /// > the time the claim is made, that claim SHALL fail. + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func claimAirdrop( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.claimAirdrop( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_unfreeze_account.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_unfreeze_account.grpc.swift new file mode 100644 index 00000000..df592898 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_unfreeze_account.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Unfreeze +/// Release a freeze on tokens of an identified type for an identified account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_unfreeze_account.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_unpause.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_unpause.grpc.swift new file mode 100644 index 00000000..0b36211f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_unpause.grpc.swift @@ -0,0 +1,24 @@ +///* +/// # Token Un-Pause +/// A transaction to "unpause" (i.e. resume) all activity for a token. While +/// a token is "paused" it cannot be transferred between accounts by any +/// transaction other than `rejectToken`. Once "unpaused", transactions involving +/// that token may resume. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_unpause.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_update.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_update.grpc.swift new file mode 100644 index 00000000..161f63bd --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_update.grpc.swift @@ -0,0 +1,23 @@ +///* +/// # Token Update +/// Modify the characteristics of an existing token. Most changes require that +/// the transaction be signed by an `admin_key`, and if that key is not valid +/// the only change permitted is to extend the token expiration. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_update.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_update_nfts.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_update_nfts.grpc.swift new file mode 100644 index 00000000..83f52db3 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_update_nfts.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Token Update NFTs +/// Given a token identifier and a metadata block, change the metadata for +/// one or more non-fungible/unique token instances. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_update_nfts.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/token_wipe_account.grpc.swift b/Sources/HieroProtobufs/Generated/services/token_wipe_account.grpc.swift new file mode 100644 index 00000000..ccbb1c7f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/token_wipe_account.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Token Wipe Account +/// Administratively burn tokens owned by a single, non-treasury, account. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/token_wipe_account.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction.grpc.swift new file mode 100644 index 00000000..e67d8b35 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Transaction +/// A (mostly legacy) wrapper around the bytes of a +/// serialized `SignedTransaction` message. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_contents.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_contents.grpc.swift new file mode 100644 index 00000000..5e069116 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_contents.grpc.swift @@ -0,0 +1,23 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_contents.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_get_fast_record.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_get_fast_record.grpc.swift new file mode 100644 index 00000000..058a600b --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_get_fast_record.grpc.swift @@ -0,0 +1,30 @@ +///* +/// # Get Fast Record +/// Get a recent transaction record "fast". +/// +/// > Important +/// >> This query is obsolete and not supported.
                      +/// >> Any query of this type that is submitted SHALL fail with a `PRE_CHECK` +/// >> result of `NOT_SUPPORTED`. +/// +/// > Implementation Note +/// >> This query is _defined_ for "Crypto" service, but is _implemented_ by +/// >> the "Network Admin" service. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_get_fast_record.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_get_receipt.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_get_receipt.grpc.swift new file mode 100644 index 00000000..dff0ff6f --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_get_receipt.grpc.swift @@ -0,0 +1,34 @@ +///* +/// # Get Transaction Receipt +/// This query is central to client interactions. A client must query +/// the network for the "receipt" after a transaction is submitted to know +/// whether the transaction succeeded and the consensus result. +/// +/// > Implementation Note +/// >> This query is _defined_ for "Crypto" service, but is _implemented_ by +/// >> the "Network Admin" service. +/// +/// > Note +/// >> The mechanism for transaction receipts and results is subject to +/// >> considerable change in the near future. Clients heavily dependent +/// >> on direct network queries for transaction receipts may consider +/// >> changes needed to query a mirror node for transaction receipts +/// >> and results instead. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_get_receipt.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_get_record.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_get_record.grpc.swift new file mode 100644 index 00000000..c6c62a90 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_get_record.grpc.swift @@ -0,0 +1,33 @@ +///* +/// # Get Transaction Record +/// Messages for a query to obtain a transaction record. This particular +/// query is used by `getTxRecordByTxID` in the "Crypto" service API. +/// +/// > Note +/// >> Much more detailed information for transaction records is available +/// >> from a mirror node, and the mirror node retains transaction records +/// >> long term, rather than for a short "cache" duration. Clients may +/// >> prefer the mirror node graph API to query transaction records, rather +/// >> than this query. +/// +/// > Implementation Note +/// >> This query is _defined_ for "Crypto" service, but is _implemented_ by +/// >> the "Network Admin" service. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_get_record.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_receipt.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_receipt.grpc.swift new file mode 100644 index 00000000..7770eba4 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_receipt.grpc.swift @@ -0,0 +1,22 @@ +///* +/// # Transaction Receipt +/// The receipt returned when the results of a transaction are requested via +/// `TransactionGetReceiptQuery`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_receipt.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_record.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_record.grpc.swift new file mode 100644 index 00000000..7f377afb --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_record.grpc.swift @@ -0,0 +1,26 @@ +///* +/// # Transaction Record +/// The record of a single transaction, including receipt and transaction +/// results such as transfer lists, entropy, contract call result, etc...
                      +/// The record also includes fees, consensus time, EVM information, and +/// other result metadata.
                      +/// Only values appropriate to the requested transaction are populated, all +/// other fields will not be set (i.e. null or default values). +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_record.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/transaction_response.grpc.swift b/Sources/HieroProtobufs/Generated/services/transaction_response.grpc.swift new file mode 100644 index 00000000..8bba6ed6 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/transaction_response.grpc.swift @@ -0,0 +1,25 @@ +///* +/// # 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/transaction_response.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/unchecked_submit.grpc.swift b/Sources/HieroProtobufs/Generated/services/unchecked_submit.grpc.swift new file mode 100644 index 00000000..d3214928 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/unchecked_submit.grpc.swift @@ -0,0 +1,27 @@ +///* +/// # Unchecked Submit +/// Submit a transaction to the network, bypassing all but the most minimal +/// validation. +/// +/// > Important +/// >> This transaction is obsolete and not supported.
                      +/// >> Any transaction of this type that is submitted SHALL fail with a +/// >> `PRE_CHECK` result of `NOT_SUPPORTED`. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/unchecked_submit.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/util_prng.grpc.swift b/Sources/HieroProtobufs/Generated/services/util_prng.grpc.swift new file mode 100644 index 00000000..38228858 --- /dev/null +++ b/Sources/HieroProtobufs/Generated/services/util_prng.grpc.swift @@ -0,0 +1,21 @@ +///* +/// # Utility PRNG query +/// A query to retrieve a deterministic pseudo-random value. +/// +/// ### 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). + +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: services/util_prng.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +// This file contained no services. \ No newline at end of file diff --git a/Sources/HieroProtobufs/Generated/services/util_service.grpc.swift b/Sources/HieroProtobufs/Generated/services/util_service.grpc.swift index a9a6f6c2..52ef67b8 100644 --- a/Sources/HieroProtobufs/Generated/services/util_service.grpc.swift +++ b/Sources/HieroProtobufs/Generated/services/util_service.grpc.swift @@ -1,467 +1,685 @@ -// +///* +/// # Utility Service +/// This service provides a transaction to generate a deterministic +/// pseudo-random value, either a 32-bit integer within a requested range +/// or a 384-bit byte array. +/// +/// ### 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). + // DO NOT EDIT. // swift-format-ignore-file // -// Generated by the protocol buffer compiler. +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. // Source: services/util_service.proto // -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -///* -/// The Utility Service provides a pseudo-random number generator. -/// -/// The single gRPC call defined for this service simply reports a single -/// pseudo-random number in the transaction record. That value may either -/// be a 32-bit integer within a requested range, or a 384-bit byte array. -/// -/// ### Block Stream Effects -/// The requested value is reported exclusively in a `UtilPrngOutput` message. -/// -/// Usage: instantiate `Proto_UtilServiceClient`, then call methods of this protocol to make API calls. -public protocol Proto_UtilServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? { get } - - func prng( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall - - func atomicBatch( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Proto_UtilServiceClientProtocol { - public var serviceName: String { - return "proto.UtilService" - } - - ///* - /// Generate a pseudo-random value. - ///

                      - /// The request body MUST be a - /// [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) - /// - /// - Parameters: - /// - request: Request to send to prng. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func prng( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_UtilServiceClientMetadata.Methods.prng.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeprngInterceptors() ?? [] - ) - } - - ///* - /// Execute a batch of transactions atomically. - ///

                      - /// All transactions in the batch will be executed in order, and if any - /// transaction fails, the entire batch will fail. - ///// TODO: Add more details about the batch transaction - /// - /// - Parameters: - /// - request: Request to send to atomicBatch. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - public func atomicBatch( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Proto_UtilServiceClientMetadata.Methods.atomicBatch.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeatomicBatchInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Proto_UtilServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Proto_UtilServiceNIOClient") -public final class Proto_UtilServiceClient: Proto_UtilServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? - public let channel: GRPCChannel - public var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - public var interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the proto.UtilService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -public struct Proto_UtilServiceNIOClient: Proto_UtilServiceClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the proto.UtilService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -///* -/// The Utility Service provides a pseudo-random number generator. -/// -/// The single gRPC call defined for this service simply reports a single -/// pseudo-random number in the transaction record. That value may either -/// be a 32-bit integer within a requested range, or a 384-bit byte array. -/// -/// ### Block Stream Effects -/// The requested value is reported exclusively in a `UtilPrngOutput` message. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_UtilServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? { get } - - func makePrngCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeAtomicBatchCall( - _ request: Proto_Transaction, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_UtilServiceAsyncClientProtocol { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_UtilServiceClientMetadata.serviceDescriptor - } - - public var interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? { - return nil - } - - public func makePrngCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_UtilServiceClientMetadata.Methods.prng.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeprngInterceptors() ?? [] - ) - } - - public func makeAtomicBatchCall( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Proto_UtilServiceClientMetadata.Methods.atomicBatch.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeatomicBatchInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_UtilServiceAsyncClientProtocol { - public func prng( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_UtilServiceClientMetadata.Methods.prng.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeprngInterceptors() ?? [] - ) - } - - public func atomicBatch( - _ request: Proto_Transaction, - callOptions: CallOptions? = nil - ) async throws -> Proto_TransactionResponse { - return try await self.performAsyncUnaryCall( - path: Proto_UtilServiceClientMetadata.Methods.atomicBatch.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeatomicBatchInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public struct Proto_UtilServiceAsyncClient: Proto_UtilServiceAsyncClientProtocol { - public var channel: GRPCChannel - public var defaultCallOptions: CallOptions - public var interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? - - public init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Proto_UtilServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } +// For information on using the generated types, please see the documentation: +// https://github.com/grpc/grpc-swift + +import GRPCCore +import GRPCProtobuf + +// MARK: - proto.UtilService + +/// Namespace containing generated types for the "proto.UtilService" service. +public enum Proto_UtilService { + /// Service descriptor for the "proto.UtilService" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.UtilService") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "prng" metadata. + public enum prng { + /// Request type for "prng". + public typealias Input = Proto_Transaction + /// Response type for "prng". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "prng". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.UtilService"), + method: "prng" + ) + } + /// Namespace for "atomicBatch" metadata. + public enum atomicBatch { + /// Request type for "atomicBatch". + public typealias Input = Proto_Transaction + /// Response type for "atomicBatch". + public typealias Output = Proto_TransactionResponse + /// Descriptor for "atomicBatch". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.UtilService"), + method: "atomicBatch" + ) + } + /// Descriptors for all methods in the "proto.UtilService" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + prng.descriptor, + atomicBatch.descriptor + ] + } } -public protocol Proto_UtilServiceClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'prng'. - func makeprngInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'atomicBatch'. - func makeatomicBatchInterceptors() -> [ClientInterceptor] +extension GRPCCore.ServiceDescriptor { + /// Service descriptor for the "proto.UtilService" service. + public static let proto_UtilService = GRPCCore.ServiceDescriptor(fullyQualifiedService: "proto.UtilService") } -public enum Proto_UtilServiceClientMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "UtilService", - fullName: "proto.UtilService", - methods: [ - Proto_UtilServiceClientMetadata.Methods.prng, - Proto_UtilServiceClientMetadata.Methods.atomicBatch, - ] - ) +// MARK: proto.UtilService (server) + +extension Proto_UtilService { + /// Streaming variant of the service protocol for the "proto.UtilService" service. + /// + /// This protocol is the lowest-level of the service protocols generated for this service + /// giving you the most flexibility over the implementation of your service. This comes at + /// the cost of more verbose and less strict APIs. Each RPC requires you to implement it in + /// terms of a request stream and response stream. Where only a single request or response + /// message is expected, you are responsible for enforcing this invariant is maintained. + /// + /// Where possible, prefer using the stricter, less-verbose ``ServiceProtocol`` + /// or ``SimpleServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Utility Service provides a pseudo-random number generator. + /// > + /// > The single gRPC call defined for this service simply reports a single + /// > pseudo-random number in the transaction record. That value may either + /// > be a 32-bit integer within a requested range, or a 384-bit byte array. + /// > + /// > ### Block Stream Effects + /// > The requested value is reported exclusively in a `UtilPrngOutput` message. + public protocol StreamingServiceProtocol: GRPCCore.RegistrableRPCService { + /// Handle the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func prng( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + + /// Handle the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - request: A streaming request of `Proto_Transaction` messages. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A streaming response of `Proto_TransactionResponse` messages. + func atomicBatch( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse + } - public enum Methods { - public static let prng = GRPCMethodDescriptor( - name: "prng", - path: "/proto.UtilService/prng", - type: GRPCCallType.unary - ) + /// Service protocol for the "proto.UtilService" service. + /// + /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than + /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and + /// trailing response metadata. If you don't need these then consider using + /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// use ``StreamingServiceProtocol``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Utility Service provides a pseudo-random number generator. + /// > + /// > The single gRPC call defined for this service simply reports a single + /// > pseudo-random number in the transaction record. That value may either + /// > be a 32-bit integer within a requested range, or a 384-bit byte array. + /// > + /// > ### Block Stream Effects + /// > The requested value is reported exclusively in a `UtilPrngOutput` message. + public protocol ServiceProtocol: Proto_UtilService.StreamingServiceProtocol { + /// Handle the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func prng( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + + /// Handle the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A response containing a single `Proto_TransactionResponse` message. + func atomicBatch( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse + } - public static let atomicBatch = GRPCMethodDescriptor( - name: "atomicBatch", - path: "/proto.UtilService/atomicBatch", - type: GRPCCallType.unary - ) - } + /// Simple service protocol for the "proto.UtilService" service. + /// + /// This is the highest level protocol for the service. The API is the easiest to use but + /// doesn't provide access to request or response metadata. If you need access to these + /// then use ``ServiceProtocol`` instead. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Utility Service provides a pseudo-random number generator. + /// > + /// > The single gRPC call defined for this service simply reports a single + /// > pseudo-random number in the transaction record. That value may either + /// > be a 32-bit integer within a requested range, or a 384-bit byte array. + /// > + /// > ### Block Stream Effects + /// > The requested value is reported exclusively in a `UtilPrngOutput` message. + public protocol SimpleServiceProtocol: Proto_UtilService.ServiceProtocol { + /// Handle the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func prng( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + + /// Handle the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - request: A `Proto_Transaction` message. + /// - context: Context providing information about the RPC. + /// - Throws: Any error which occurred during the processing of the request. Thrown errors + /// of type `RPCError` are mapped to appropriate statuses. All other errors are converted + /// to an internal error. + /// - Returns: A `Proto_TransactionResponse` to respond with. + func atomicBatch( + request: Proto_Transaction, + context: GRPCCore.ServerContext + ) async throws -> Proto_TransactionResponse + } } -///* -/// The Utility Service provides a pseudo-random number generator. -/// -/// The single gRPC call defined for this service simply reports a single -/// pseudo-random number in the transaction record. That value may either -/// be a 32-bit integer within a requested range, or a 384-bit byte array. -/// -/// ### Block Stream Effects -/// The requested value is reported exclusively in a `UtilPrngOutput` message. -/// -/// To build a server, implement a class that conforms to this protocol. -public protocol Proto_UtilServiceProvider: CallHandlerProvider { - var interceptors: Proto_UtilServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Generate a pseudo-random value. - ///

                      - /// The request body MUST be a - /// [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) - func prng(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture - - ///* - /// Execute a batch of transactions atomically. - ///

                      - /// All transactions in the batch will be executed in order, and if any - /// transaction fails, the entire batch will fail. - ///// TODO: Add more details about the batch transaction - func atomicBatch(request: Proto_Transaction, context: StatusOnlyCallContext) -> EventLoopFuture +// Default implementation of 'registerMethods(with:)'. +extension Proto_UtilService.StreamingServiceProtocol { + public func registerMethods(with router: inout GRPCCore.RPCRouter) where Transport: GRPCCore.ServerTransport { + router.registerHandler( + forMethod: Proto_UtilService.Method.prng.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.prng( + request: request, + context: context + ) + } + ) + router.registerHandler( + forMethod: Proto_UtilService.Method.atomicBatch.descriptor, + deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + handler: { request, context in + try await self.atomicBatch( + request: request, + context: context + ) + } + ) + } } -extension Proto_UtilServiceProvider { - public var serviceName: Substring { - return Proto_UtilServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "prng": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeprngInterceptors() ?? [], - userFunction: self.prng(request:context:) - ) - - case "atomicBatch": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeatomicBatchInterceptors() ?? [], - userFunction: self.atomicBatch(request:context:) - ) +// Default implementation of streaming methods from 'StreamingServiceProtocol'. +extension Proto_UtilService.ServiceProtocol { + public func prng( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.prng( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) + } - default: - return nil + public func atomicBatch( + request: GRPCCore.StreamingServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.StreamingServerResponse { + let response = try await self.atomicBatch( + request: GRPCCore.ServerRequest(stream: request), + context: context + ) + return GRPCCore.StreamingServerResponse(single: response) } - } } -///* -/// The Utility Service provides a pseudo-random number generator. -/// -/// The single gRPC call defined for this service simply reports a single -/// pseudo-random number in the transaction record. That value may either -/// be a 32-bit integer within a requested range, or a 384-bit byte array. -/// -/// ### Block Stream Effects -/// The requested value is reported exclusively in a `UtilPrngOutput` message. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -public protocol Proto_UtilServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Proto_UtilServiceServerInterceptorFactoryProtocol? { get } - - ///* - /// Generate a pseudo-random value. - ///

                      - /// The request body MUST be a - /// [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) - func prng( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse +// Default implementation of methods from 'ServiceProtocol'. +extension Proto_UtilService.SimpleServiceProtocol { + public func prng( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.prng( + request: request.message, + context: context + ), + metadata: [:] + ) + } - ///* - /// Execute a batch of transactions atomically. - ///

                      - /// All transactions in the batch will be executed in order, and if any - /// transaction fails, the entire batch will fail. - ///// TODO: Add more details about the batch transaction - func atomicBatch( - request: Proto_Transaction, - context: GRPCAsyncServerCallContext - ) async throws -> Proto_TransactionResponse + public func atomicBatch( + request: GRPCCore.ServerRequest, + context: GRPCCore.ServerContext + ) async throws -> GRPCCore.ServerResponse { + return GRPCCore.ServerResponse( + message: try await self.atomicBatch( + request: request.message, + context: context + ), + metadata: [:] + ) + } } -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Proto_UtilServiceAsyncProvider { - public static var serviceDescriptor: GRPCServiceDescriptor { - return Proto_UtilServiceServerMetadata.serviceDescriptor - } - - public var serviceName: Substring { - return Proto_UtilServiceServerMetadata.serviceDescriptor.fullName[...] - } - - public var interceptors: Proto_UtilServiceServerInterceptorFactoryProtocol? { - return nil - } - - public func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "prng": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeprngInterceptors() ?? [], - wrapping: { try await self.prng(request: $0, context: $1) } - ) - - case "atomicBatch": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeatomicBatchInterceptors() ?? [], - wrapping: { try await self.atomicBatch(request: $0, context: $1) } - ) +// MARK: proto.UtilService (client) + +extension Proto_UtilService { + /// Generated client protocol for the "proto.UtilService" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Utility Service provides a pseudo-random number generator. + /// > + /// > The single gRPC call defined for this service simply reports a single + /// > pseudo-random number in the transaction record. That value may either + /// > be a 32-bit integer within a requested range, or a 384-bit byte array. + /// > + /// > ### Block Stream Effects + /// > The requested value is reported exclusively in a `UtilPrngOutput` message. + public protocol ClientProtocol: Sendable { + /// Call the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func prng( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + + /// Call the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + func atomicBatch( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + ) async throws -> Result where Result: Sendable + } - default: - return nil + /// Generated client for the "proto.UtilService" service. + /// + /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps + /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived + /// means of communication with the remote peer. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > The Utility Service provides a pseudo-random number generator. + /// > + /// > The single gRPC call defined for this service simply reports a single + /// > pseudo-random number in the transaction record. That value may either + /// > be a 32-bit integer within a requested range, or a 384-bit byte array. + /// > + /// > ### Block Stream Effects + /// > The requested value is reported exclusively in a `UtilPrngOutput` message. + public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { + private let client: GRPCCore.GRPCClient + + /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. + /// + /// - Parameters: + /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. + public init(wrapping client: GRPCCore.GRPCClient) { + self.client = client + } + + /// Call the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func prng( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_UtilService.Method.prng.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - serializer: A serializer for `Proto_Transaction` messages. + /// - deserializer: A deserializer for `Proto_TransactionResponse` messages. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func atomicBatch( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.client.unary( + request: request, + descriptor: Proto_UtilService.Method.atomicBatch.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } } - } } -public protocol Proto_UtilServiceServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'prng'. - /// Defaults to calling `self.makeInterceptors()`. - func makeprngInterceptors() -> [ServerInterceptor] +// Helpers providing default arguments to 'ClientProtocol' methods. +extension Proto_UtilService.ClientProtocol { + /// Call the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func prng( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.prng( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } - /// - Returns: Interceptors to use when handling 'atomicBatch'. - /// Defaults to calling `self.makeInterceptors()`. - func makeatomicBatchInterceptors() -> [ServerInterceptor] + /// Call the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - request: A request containing a single `Proto_Transaction` message. + /// - options: Options to apply to this RPC. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func atomicBatch( + request: GRPCCore.ClientRequest, + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + try await self.atomicBatch( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } -public enum Proto_UtilServiceServerMetadata { - public static let serviceDescriptor = GRPCServiceDescriptor( - name: "UtilService", - fullName: "proto.UtilService", - methods: [ - Proto_UtilServiceServerMetadata.Methods.prng, - Proto_UtilServiceServerMetadata.Methods.atomicBatch, - ] - ) - - public enum Methods { - public static let prng = GRPCMethodDescriptor( - name: "prng", - path: "/proto.UtilService/prng", - type: GRPCCallType.unary - ) +// Helpers providing sugared APIs for 'ClientProtocol' methods. +extension Proto_UtilService.ClientProtocol { + /// Call the "prng" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Generate a pseudo-random value. + /// >

                      + /// > The request body MUST be a + /// > [UtilPrngTransactionBody](#proto.UtilPrngTransactionBody) + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func prng( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.prng( + request: request, + options: options, + onResponse: handleResponse + ) + } - public static let atomicBatch = GRPCMethodDescriptor( - name: "atomicBatch", - path: "/proto.UtilService/atomicBatch", - type: GRPCCallType.unary - ) - } -} + /// Call the "atomicBatch" method. + /// + /// > Source IDL Documentation: + /// > + /// > + /// > Execute a batch of transactions atomically. + /// >

                      + /// > All transactions in the batch will be executed in order, and if any + /// > transaction fails, the entire batch will fail. + /// > / TODO: Add more details about the batch transaction + /// + /// - Parameters: + /// - message: request message to send. + /// - metadata: Additional metadata to send, defaults to empty. + /// - options: Options to apply to this RPC, defaults to `.defaults`. + /// - handleResponse: A closure which handles the response, the result of which is + /// returned to the caller. Returning from the closure will cancel the RPC if it + /// hasn't already finished. + /// - Returns: The result of `handleResponse`. + public func atomicBatch( + _ message: Proto_Transaction, + metadata: GRPCCore.Metadata = [:], + options: GRPCCore.CallOptions = .defaults, + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + try response.message + } + ) async throws -> Result where Result: Sendable { + let request = GRPCCore.ClientRequest( + message: message, + metadata: metadata + ) + return try await self.atomicBatch( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file