diff --git a/BlockchainSdk.xcodeproj/project.pbxproj b/BlockchainSdk.xcodeproj/project.pbxproj index 8b173ad40..6c5f41c6e 100644 --- a/BlockchainSdk.xcodeproj/project.pbxproj +++ b/BlockchainSdk.xcodeproj/project.pbxproj @@ -484,8 +484,6 @@ DA1D3B7B2B57B8FB00247393 /* BigUInt+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA1D3B7A2B57B8FB00247393 /* BigUInt+.swift */; }; DA2309D52C123510002A930C /* FeeResourceRestrictable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2309D42C123510002A930C /* FeeResourceRestrictable.swift */; }; DA2E770029769BF6001FF957 /* TransactionCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2E76FF29769BF5001FF957 /* TransactionCreator.swift */; }; - DA30812B2817BF3C00DE41F1 /* Tron.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA30812A2817BF3C00DE41F1 /* Tron.pb.swift */; }; - DA30812F2817C0F900DE41F1 /* Contracts.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA30812E2817C0F900DE41F1 /* Contracts.pb.swift */; }; DA3081322817EC1A00DE41F1 /* TronTransactionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA3081312817EC1A00DE41F1 /* TronTransactionBuilder.swift */; }; DA346451279A802E00E77B1D /* SolanaSdk+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA346450279A802E00E77B1D /* SolanaSdk+.swift */; }; DA3738F129EFDF9600439F6B /* PrivateKeySigner+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA3738EF29EFDF9600439F6B /* PrivateKeySigner+.swift */; }; @@ -703,6 +701,22 @@ DC87B9F02B8F4D9700C61C5A /* BitcoreResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC87B9ED2B8F4D9700C61C5A /* BitcoreResponse.swift */; }; DC87B9F12B8F4D9700C61C5A /* BitcoreTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC87B9EE2B8F4D9700C61C5A /* BitcoreTarget.swift */; }; DC886FCD2AF5637D0098669C /* CommonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC886FCC2AF5637D0098669C /* CommonTests.swift */; }; + DCDF56C32C6F4F9800028424 /* account_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B32C6F4F9800028424 /* account_contract.pb.swift */; }; + DCDF56C42C6F4F9800028424 /* asset_issue_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B42C6F4F9800028424 /* asset_issue_contract.pb.swift */; }; + DCDF56C52C6F4F9800028424 /* balance_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B52C6F4F9800028424 /* balance_contract.pb.swift */; }; + DCDF56C62C6F4F9800028424 /* common.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B62C6F4F9800028424 /* common.pb.swift */; }; + DCDF56C72C6F4F9800028424 /* exchange_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B72C6F4F9800028424 /* exchange_contract.pb.swift */; }; + DCDF56C82C6F4F9800028424 /* market_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B82C6F4F9800028424 /* market_contract.pb.swift */; }; + DCDF56C92C6F4F9800028424 /* proposal_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56B92C6F4F9800028424 /* proposal_contract.pb.swift */; }; + DCDF56CA2C6F4F9800028424 /* shield_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56BA2C6F4F9800028424 /* shield_contract.pb.swift */; }; + DCDF56CB2C6F4F9800028424 /* smart_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56BB2C6F4F9800028424 /* smart_contract.pb.swift */; }; + DCDF56CC2C6F4F9800028424 /* storage_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56BC2C6F4F9800028424 /* storage_contract.pb.swift */; }; + DCDF56CD2C6F4F9800028424 /* vote_asset_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56BD2C6F4F9800028424 /* vote_asset_contract.pb.swift */; }; + DCDF56CE2C6F4F9800028424 /* witness_contract.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56BE2C6F4F9800028424 /* witness_contract.pb.swift */; }; + DCDF56CF2C6F4F9800028424 /* Discover.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56C02C6F4F9800028424 /* Discover.pb.swift */; }; + DCDF56D02C6F4F9800028424 /* TronInventoryItems.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56C12C6F4F9800028424 /* TronInventoryItems.pb.swift */; }; + DCDF56D12C6F4F9800028424 /* Tron.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56C22C6F4F9800028424 /* Tron.pb.swift */; }; + DCDF56D32C6F50DF00028424 /* TronStakeKitTransactionHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDF56D22C6F50DF00028424 /* TronStakeKitTransactionHelper.swift */; }; DCF5E0E52C6A361A00062F28 /* TronTransactionParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCF5E0E42C6A361A00062F28 /* TronTransactionParams.swift */; }; DCF5E0FB2C6A455300062F28 /* TronFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCF5E0FA2C6A455300062F28 /* TronFunction.swift */; }; E93532CE292D0E86008FD979 /* BlockBookUtxoProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9941ACA2927B07300399DE3 /* BlockBookUtxoProvider.swift */; }; @@ -1394,12 +1408,7 @@ DA1D3B7A2B57B8FB00247393 /* BigUInt+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BigUInt+.swift"; sourceTree = ""; }; DA2309D42C123510002A930C /* FeeResourceRestrictable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeeResourceRestrictable.swift; sourceTree = ""; }; DA2E76FF29769BF5001FF957 /* TransactionCreator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionCreator.swift; sourceTree = ""; }; - DA3081282817BF1D00DE41F1 /* Tron.proto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.protobuf; path = Tron.proto; sourceTree = ""; }; - DA30812A2817BF3C00DE41F1 /* Tron.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tron.pb.swift; sourceTree = ""; }; - DA30812D2817C0C200DE41F1 /* Contracts.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = Contracts.proto; sourceTree = ""; }; - DA30812E2817C0F900DE41F1 /* Contracts.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Contracts.pb.swift; sourceTree = ""; }; DA3081312817EC1A00DE41F1 /* TronTransactionBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronTransactionBuilder.swift; sourceTree = ""; }; - DA30813428182F0C00DE41F1 /* Tron Protobuf.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = "Tron Protobuf.md"; sourceTree = ""; }; DA346450279A802E00E77B1D /* SolanaSdk+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SolanaSdk+.swift"; sourceTree = ""; }; DA3738EF29EFDF9600439F6B /* PrivateKeySigner+.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PrivateKeySigner+.swift"; sourceTree = ""; }; DA3738F029EFDF9600439F6B /* XCTAssert+.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTAssert+.swift"; sourceTree = ""; }; @@ -1620,6 +1629,22 @@ DC87B9ED2B8F4D9700C61C5A /* BitcoreResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BitcoreResponse.swift; sourceTree = ""; }; DC87B9EE2B8F4D9700C61C5A /* BitcoreTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BitcoreTarget.swift; sourceTree = ""; }; DC886FCC2AF5637D0098669C /* CommonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonTests.swift; sourceTree = ""; }; + DCDF56B32C6F4F9800028424 /* account_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = account_contract.pb.swift; sourceTree = ""; }; + DCDF56B42C6F4F9800028424 /* asset_issue_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = asset_issue_contract.pb.swift; sourceTree = ""; }; + DCDF56B52C6F4F9800028424 /* balance_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = balance_contract.pb.swift; sourceTree = ""; }; + DCDF56B62C6F4F9800028424 /* common.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = common.pb.swift; sourceTree = ""; }; + DCDF56B72C6F4F9800028424 /* exchange_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = exchange_contract.pb.swift; sourceTree = ""; }; + DCDF56B82C6F4F9800028424 /* market_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = market_contract.pb.swift; sourceTree = ""; }; + DCDF56B92C6F4F9800028424 /* proposal_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = proposal_contract.pb.swift; sourceTree = ""; }; + DCDF56BA2C6F4F9800028424 /* shield_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = shield_contract.pb.swift; sourceTree = ""; }; + DCDF56BB2C6F4F9800028424 /* smart_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = smart_contract.pb.swift; sourceTree = ""; }; + DCDF56BC2C6F4F9800028424 /* storage_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = storage_contract.pb.swift; sourceTree = ""; }; + DCDF56BD2C6F4F9800028424 /* vote_asset_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = vote_asset_contract.pb.swift; sourceTree = ""; }; + DCDF56BE2C6F4F9800028424 /* witness_contract.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = witness_contract.pb.swift; sourceTree = ""; }; + DCDF56C02C6F4F9800028424 /* Discover.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Discover.pb.swift; sourceTree = ""; }; + DCDF56C12C6F4F9800028424 /* TronInventoryItems.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TronInventoryItems.pb.swift; sourceTree = ""; }; + DCDF56C22C6F4F9800028424 /* Tron.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tron.pb.swift; sourceTree = ""; }; + DCDF56D22C6F50DF00028424 /* TronStakeKitTransactionHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TronStakeKitTransactionHelper.swift; sourceTree = ""; }; DCE3379A28F2B7260029A6F5 /* BlockchainSdkExample.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = BlockchainSdkExample.entitlements; sourceTree = ""; }; DCF5E0E42C6A361A00062F28 /* TronTransactionParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronTransactionParams.swift; sourceTree = ""; }; DCF5E0FA2C6A455300062F28 /* TronFunction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronFunction.swift; sourceTree = ""; }; @@ -3387,11 +3412,10 @@ DA3081222817AEB800DE41F1 /* protobuf */ = { isa = PBXGroup; children = ( - DA30813428182F0C00DE41F1 /* Tron Protobuf.md */, - DA3081282817BF1D00DE41F1 /* Tron.proto */, - DA30812D2817C0C200DE41F1 /* Contracts.proto */, - DA30812A2817BF3C00DE41F1 /* Tron.pb.swift */, - DA30812E2817C0F900DE41F1 /* Contracts.pb.swift */, + DCDF56BF2C6F4F9800028424 /* contract */, + DCDF56C02C6F4F9800028424 /* Discover.pb.swift */, + DCDF56C22C6F4F9800028424 /* Tron.pb.swift */, + DCDF56C12C6F4F9800028424 /* TronInventoryItems.pb.swift */, ); path = protobuf; sourceTree = ""; @@ -3499,6 +3523,7 @@ DA9F76E727EC8AD900F0665C /* Tron */ = { isa = PBXGroup; children = ( + DCDF56D22C6F50DF00028424 /* TronStakeKitTransactionHelper.swift */, DA9F76E827EC8AEB00F0665C /* TronAddressService.swift */, B00B58C72BCEB9F4007475F7 /* TronAPIResolver.swift */, EF3B19452AA85E620084AA1C /* TronExternalLinkProvider.swift */, @@ -3918,6 +3943,25 @@ path = Bitcore; sourceTree = ""; }; + DCDF56BF2C6F4F9800028424 /* contract */ = { + isa = PBXGroup; + children = ( + DCDF56B32C6F4F9800028424 /* account_contract.pb.swift */, + DCDF56B42C6F4F9800028424 /* asset_issue_contract.pb.swift */, + DCDF56B52C6F4F9800028424 /* balance_contract.pb.swift */, + DCDF56B62C6F4F9800028424 /* common.pb.swift */, + DCDF56B72C6F4F9800028424 /* exchange_contract.pb.swift */, + DCDF56B82C6F4F9800028424 /* market_contract.pb.swift */, + DCDF56B92C6F4F9800028424 /* proposal_contract.pb.swift */, + DCDF56BA2C6F4F9800028424 /* shield_contract.pb.swift */, + DCDF56BB2C6F4F9800028424 /* smart_contract.pb.swift */, + DCDF56BC2C6F4F9800028424 /* storage_contract.pb.swift */, + DCDF56BD2C6F4F9800028424 /* vote_asset_contract.pb.swift */, + DCDF56BE2C6F4F9800028424 /* witness_contract.pb.swift */, + ); + path = contract; + sourceTree = ""; + }; E9941AC72927845C00399DE3 /* BlockBook */ = { isa = PBXGroup; children = ( @@ -4546,6 +4590,7 @@ DA63B09D29CB3FC700AC6E49 /* KaspaNetworkService.swift in Sources */, B633EA292B8FD7B200F11BFF /* BlockBookTransactionHistoryTotalPageCountExtractor.swift in Sources */, EF57BED62A1E19E800C2A493 /* DerivationStyle.swift in Sources */, + DCDF56D12C6F4F9800028424 /* Tron.pb.swift in Sources */, B6F89EA22BB20D5B0009A453 /* SubscanAPIParams.AccountInfo.swift in Sources */, EF3B194C2AA85E880084AA1C /* GnosisExternalLinkProvider.swift in Sources */, B6E5C1C02B58637300AAC80D /* VeChainNetworkResult.ContractCall+.swift in Sources */, @@ -4594,6 +4639,7 @@ 2DA139F92A8AD82E00E3C374 /* ChiaCondition.swift in Sources */, 2DDE5BAE29C4F8D200A5B708 /* TronWalletAssembly.swift in Sources */, EF9E381D2B7A43A5004B694C /* DustRestrictable.swift in Sources */, + DCDF56C52C6F4F9800028424 /* balance_contract.pb.swift in Sources */, B00B58C42BCEB917007475F7 /* APIKeysInfoProvider.swift in Sources */, EFF82D522BA084CE004DF1A0 /* URLSessionWebSocketTaskWrapper.swift in Sources */, B05145012B57F18D00EDAD1E /* EVMSmartContractInteractorFactory.swift in Sources */, @@ -4632,11 +4678,11 @@ DC5E64F82B1650F400E81AA5 /* OP_LESSTHANOREQUAL.swift in Sources */, EF7257902A8F938400EA8CB2 /* KeyedDecodingContainer+.swift in Sources */, EF3B19462AA85E620084AA1C /* TronExternalLinkProvider.swift in Sources */, + DCDF56C92C6F4F9800028424 /* proposal_contract.pb.swift in Sources */, DC5E64FD2B1650F400E81AA5 /* OP_NOT.swift in Sources */, B0C34958267B83580027CC9D /* BitcoinModels.swift in Sources */, DA63B0A029CB3FC700AC6E49 /* KaspaAddressComponents.swift in Sources */, DAFE0D0C2BB1841B005CBD9C /* FlareExternalLinkProvider.swift in Sources */, - DA30812B2817BF3C00DE41F1 /* Tron.pb.swift in Sources */, DC5E64DD2B1650F400E81AA5 /* OP_CHECKMULTISIG.swift in Sources */, EF57BED82A1E624100C2A493 /* DerivationConfigV1.swift in Sources */, B63068C72B31050900E79053 /* VeChainWalletAssembly.swift in Sources */, @@ -4662,6 +4708,7 @@ 2D8501F729DEC20A00F4A11B /* TONTransactionParams.swift in Sources */, 5D8653FC23A8C4A9000DE52D /* StellarTransactionBuilder.swift in Sources */, B6B0835C2AE6BED40099D6F8 /* NullValue.swift in Sources */, + DCDF56C62C6F4F9800028424 /* common.pb.swift in Sources */, DC5E64DC2B1650F400E81AA5 /* OP_CHECKMULTISIGVERIFY.swift in Sources */, DC5E652E2B1650F400E81AA5 /* OP_IF.swift in Sources */, EF937BDF2B90EED0009B8374 /* RentProvider.swift in Sources */, @@ -4721,6 +4768,7 @@ 0AF503312C199A6200193358 /* ICPWalletAssembly.swift in Sources */, DC5E65252B1650F400E81AA5 /* OP_RESERVED.swift in Sources */, 5D908C5726A6D39C00270FA3 /* BinanceTransactionParams.swift in Sources */, + DCDF56C72C6F4F9800028424 /* exchange_contract.pb.swift in Sources */, EF9E382D2B7A47C7004B694C /* AnyPublisher+Async.swift in Sources */, 5D7D243825136254001B9A4F /* Entropy.swift in Sources */, 5DE3BFA4239FB4E500E8815D /* BitcoinNetworkService.swift in Sources */, @@ -4743,7 +4791,6 @@ B675E9632B320E7F004AF179 /* VeChainNetworkResult.TransactionInfo.swift in Sources */, 2DDE5BAF29C4F8D200A5B708 /* DashWalletAssembly.swift in Sources */, DA0E98D22C04708E00C92985 /* KoinosNetworkProvider.swift in Sources */, - DA30812F2817C0F900DE41F1 /* Contracts.pb.swift in Sources */, DC3C8E132C32DEF600615EAB /* CardanoTokenContractAddressService.swift in Sources */, 5D0EEE69253EF75200758FDC /* TezosFee.swift in Sources */, DC47723B2C29F64B00D2459D /* EthereumAddressConverterError.swift in Sources */, @@ -4790,6 +4837,7 @@ 2D9A91A129BB8C1700476EA6 /* TONProviderModels.swift in Sources */, EF3B19282AA85C740084AA1C /* DisChainExternalLinkProvider.swift in Sources */, B6F89EA12BB20D5B0009A453 /* SubscanAPIParams.ExtrinsicInfo.swift in Sources */, + DCDF56CD2C6F4F9800028424 /* vote_asset_contract.pb.swift in Sources */, DA9EA73F29EE958500CAE6F2 /* CosmosTransactionParams.swift in Sources */, 2DDEFBCC2B59B42E00885675 /* AlgorandTransactionBuildParams.swift in Sources */, EF3FFFFF2A27740400C6E7D9 /* AdaliteBaseResponseDTO.swift in Sources */, @@ -4823,6 +4871,7 @@ 5DE3BFA0239FA33800E8815D /* Bech32.swift in Sources */, 2DDEFBC32B59B36A00885675 /* AlgorandTransactionBuilder.swift in Sources */, DA55032F2BFDF47500817BDA /* KoinosTransactionParams.swift in Sources */, + DCDF56CC2C6F4F9800028424 /* storage_contract.pb.swift in Sources */, 2DA4A4372BB46FE400E55526 /* RadiantExternalLinkProvider.swift in Sources */, DC5E64F42B1650F400E81AA5 /* OP_MAX.swift in Sources */, B04DC62725AC1C50009AA7B3 /* JSONDecoder+.swift in Sources */, @@ -4841,6 +4890,7 @@ DC5E64F62B1650F400E81AA5 /* OP_LESSTHAN.swift in Sources */, 5DEAFA90244473460032E316 /* Transaction.swift in Sources */, 5D977BB623FAEB4500575BE4 /* DucatusNetworkService.swift in Sources */, + DCDF56C82C6F4F9800028424 /* market_contract.pb.swift in Sources */, DC5E65212B1650F400E81AA5 /* OP_2ROT.swift in Sources */, B6739BE72C24688600F41A47 /* HederaNetworkResult.AccountBalance.swift in Sources */, 2DDE5BAB29C4F8D200A5B708 /* StellarWalletAssembly.swift in Sources */, @@ -4969,8 +5019,10 @@ 5D8653FA23A8C481000DE52D /* StellarNetworkService.swift in Sources */, 2DA4A4452BB5431700E55526 /* RadiantAmountUnspentTransaction.swift in Sources */, 2DDE2C322BCD592A002A8D3C /* AptosAddressService.swift in Sources */, + DCDF56CF2C6F4F9800028424 /* Discover.pb.swift in Sources */, DC5E64DA2B1650F400E81AA5 /* OP_HASH160.swift in Sources */, 2DA4A4472BB5431700E55526 /* RadiantUnspentOutput.swift in Sources */, + DCDF56CE2C6F4F9800028424 /* witness_contract.pb.swift in Sources */, DC63F266293F243200F953EF /* Credentials.swift in Sources */, EF2D9DB32BC4033E0055C485 /* JSONRPC.swift in Sources */, DC87B9EF2B8F4D9700C61C5A /* BitcoreProvider.swift in Sources */, @@ -5068,6 +5120,7 @@ 0AA9E3792B9A03450084E8A7 /* MantaExternalLinkProvider.swift in Sources */, 2DDE5BB229C4F8F700A5B708 /* TONWalletAssembly.swift in Sources */, DA656FC62952091A0092CC61 /* BlockBookConfig.swift in Sources */, + DCDF56C42C6F4F9800028424 /* asset_issue_contract.pb.swift in Sources */, DC5E64FE2B1650F400E81AA5 /* OP_GREATERTHAN.swift in Sources */, B64A680F2BCE9F40009ED960 /* EthereumOptimisticRollupSmartContract.swift in Sources */, DC5E64E82B1650F400E81AA5 /* OP_EQUALVERIFY.swift in Sources */, @@ -5103,6 +5156,7 @@ 5D7D243C25136254001B9A4F /* SerializerDefinitions.swift in Sources */, DC5E65002B1650F400E81AA5 /* OP_WITHIN.swift in Sources */, 2DA13A072A8AD83B00E3C374 /* ChiaNetworkService.swift in Sources */, + DCDF56CB2C6F4F9800028424 /* smart_contract.pb.swift in Sources */, 5DEAFA8E244472CD0032E316 /* Amount.swift in Sources */, 2D9A91A729BB8C2E00476EA6 /* WalletCoreAddressService.swift in Sources */, 0A158C052B74E4680004DC23 /* BitcoinCashNowNodesNetworkProvider.swift in Sources */, @@ -5166,6 +5220,7 @@ 5D304397239A6B960066B8D9 /* String+.swift in Sources */, 5DC7DD6824408266008F83F2 /* XrpResponse.swift in Sources */, 2D24F5C42B6D2C7100D502A0 /* AptosResponse.swift in Sources */, + DCDF56D02C6F4F9800028424 /* TronInventoryItems.pb.swift in Sources */, DC5E65052B1650F400E81AA5 /* OP_MIN.swift in Sources */, 5D7D243D25136254001B9A4F /* Serializer.swift in Sources */, B6181AE32B757AA50046A976 /* HederaError.swift in Sources */, @@ -5189,7 +5244,9 @@ B07EE8B225AC1504009DB163 /* DateFormatter+.swift in Sources */, 5D557CB523ACCAD2009B32AF /* BlockcypherNetworkProvider.swift in Sources */, 5D7D243725136254001B9A4F /* XRPCurrentLedgerInfo.swift in Sources */, + DCDF56C32C6F4F9800028424 /* account_contract.pb.swift in Sources */, B633EA132B8FC58900F11BFF /* AlgorandIndexProviderTarget.swift in Sources */, + DCDF56CA2C6F4F9800028424 /* shield_contract.pb.swift in Sources */, 2DA13A032A8AD83B00E3C374 /* ChiaProviderTarget.swift in Sources */, EF666C2A2A2DFB120044986F /* WalletManagerFactory.swift in Sources */, EF3B195C2AA85EF40084AA1C /* TerraV2ExternalLinkProvider.swift in Sources */, @@ -5205,6 +5262,7 @@ B6B2EB6D2B56AAB9005FBE8E /* VeChainNetworkResult.ContractCall.swift in Sources */, EF57BEC82A1E13BE00C2A493 /* DerivationConfig.swift in Sources */, DA0E98D62C04755C00C92985 /* KoinosMethod.swift in Sources */, + DCDF56D32C6F50DF00028424 /* TronStakeKitTransactionHelper.swift in Sources */, DA198B5B29E3FF4F00DB6EEA /* CosmosTarget.swift in Sources */, EF2D9DA02BC3F6770055C485 /* EthereumNetworkService.swift in Sources */, B6DC284A2B62BBFE0070F1D2 /* HederaTransactionBuilder.swift in Sources */, diff --git a/BlockchainSdk/Blockchains/Tron/TronStakeKitTransactionHelper.swift b/BlockchainSdk/Blockchains/Tron/TronStakeKitTransactionHelper.swift new file mode 100644 index 000000000..89dfc8c6c --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/TronStakeKitTransactionHelper.swift @@ -0,0 +1,17 @@ +// +// TronStakeKitTransactionHelper.swift +// BlockchainSdk +// +// Created by Alexander Osokin on 16.08.2024. +// Copyright © 2024 Tangem AG. All rights reserved. +// + +import Foundation + +struct TronStakeKitTransactionHelper { + func prepareForSign(_ unsignedData: String) throws -> TronPresignedInput { + let rawData = try Protocol_Transaction.raw(serializedData: Data(hex: unsignedData)) + let hash = try rawData.serializedData().sha256() + return .init(rawData: rawData, hash: hash) + } +} diff --git a/BlockchainSdk/Blockchains/Tron/TronWalletManager.swift b/BlockchainSdk/Blockchains/Tron/TronWalletManager.swift index c3036f463..b0797532b 100644 --- a/BlockchainSdk/Blockchains/Tron/TronWalletManager.swift +++ b/BlockchainSdk/Blockchains/Tron/TronWalletManager.swift @@ -259,3 +259,41 @@ extension TronWalletManager: TronTransactionDataBuilder { } } +// MARK: - StakeKitTransactionSender + +extension TronWalletManager: StakeKitTransactionSender { + func sendStakeKit(transaction: StakeKitTransaction, signer: any TransactionSigner) -> AnyPublisher { + Result { + try TronStakeKitTransactionHelper().prepareForSign(transaction.unsignedData) + } + .publisher + .withWeakCaptureOf(self) + .flatMap { manager, input in + signer + .sign(hash: input.hash, walletPublicKey: manager.wallet.publicKey) + .tryMap { signature in + try manager.txBuilder.buildForSend(rawData: input.rawData, signature: signature) + } + } + .withWeakCaptureOf(self) + .flatMap { manager, data in + manager.networkService + .broadcastHex(data) + .mapSendError(tx: data.hexString) + } + .withWeakCaptureOf(self) + .tryMap { manager, broadcastResponse in + guard broadcastResponse.result == true else { + throw WalletError.failedToSendTx + } + + let hash = broadcastResponse.txid + let mapper = PendingTransactionRecordMapper() + let record = mapper.mapToPendingTransactionRecord(stakeKitTransaction: transaction, hash: hash) + manager.wallet.addPendingTransaction(record) + return TransactionSendResult(hash: hash) + } + .eraseSendError() + .eraseToAnyPublisher() + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/Contracts.proto b/BlockchainSdk/Blockchains/Tron/protobuf/Contracts.proto deleted file mode 100644 index 04f71eba3..000000000 --- a/BlockchainSdk/Blockchains/Tron/protobuf/Contracts.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package protocol; - -message TransferContract { - bytes owner_address = 1; - bytes to_address = 2; - int64 amount = 3; -} - -message TriggerSmartContract { - bytes owner_address = 1; - bytes contract_address = 2; - int64 call_value = 3; - bytes data = 4; - int64 call_token_value = 5; - int64 token_id = 6; -} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/Discover.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/Discover.pb.swift new file mode 100644 index 000000000..6e8cace6e --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/Discover.pb.swift @@ -0,0 +1,445 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: Discover.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_Endpoint: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: Data = Data() + + var port: Int32 = 0 + + var nodeID: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_PingMessage: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var from: Protocol_Endpoint { + get {return _from ?? Protocol_Endpoint()} + set {_from = newValue} + } + /// Returns true if `from` has been explicitly set. + var hasFrom: Bool {return self._from != nil} + /// Clears the value of `from`. Subsequent reads from it will return its default value. + mutating func clearFrom() {self._from = nil} + + var to: Protocol_Endpoint { + get {return _to ?? Protocol_Endpoint()} + set {_to = newValue} + } + /// Returns true if `to` has been explicitly set. + var hasTo: Bool {return self._to != nil} + /// Clears the value of `to`. Subsequent reads from it will return its default value. + mutating func clearTo() {self._to = nil} + + var version: Int32 = 0 + + var timestamp: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _from: Protocol_Endpoint? = nil + fileprivate var _to: Protocol_Endpoint? = nil +} + +struct Protocol_PongMessage: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var from: Protocol_Endpoint { + get {return _from ?? Protocol_Endpoint()} + set {_from = newValue} + } + /// Returns true if `from` has been explicitly set. + var hasFrom: Bool {return self._from != nil} + /// Clears the value of `from`. Subsequent reads from it will return its default value. + mutating func clearFrom() {self._from = nil} + + var echo: Int32 = 0 + + var timestamp: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _from: Protocol_Endpoint? = nil +} + +struct Protocol_FindNeighbours: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var from: Protocol_Endpoint { + get {return _from ?? Protocol_Endpoint()} + set {_from = newValue} + } + /// Returns true if `from` has been explicitly set. + var hasFrom: Bool {return self._from != nil} + /// Clears the value of `from`. Subsequent reads from it will return its default value. + mutating func clearFrom() {self._from = nil} + + var targetID: Data = Data() + + var timestamp: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _from: Protocol_Endpoint? = nil +} + +struct Protocol_Neighbours: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var from: Protocol_Endpoint { + get {return _from ?? Protocol_Endpoint()} + set {_from = newValue} + } + /// Returns true if `from` has been explicitly set. + var hasFrom: Bool {return self._from != nil} + /// Clears the value of `from`. Subsequent reads from it will return its default value. + mutating func clearFrom() {self._from = nil} + + var neighbours: [Protocol_Endpoint] = [] + + var timestamp: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _from: Protocol_Endpoint? = nil +} + +struct Protocol_BackupMessage: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var flag: Bool = false + + var priority: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_Endpoint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Endpoint" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "address"), + 2: .same(proto: "port"), + 3: .same(proto: "nodeId"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.port) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.nodeID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 1) + } + if self.port != 0 { + try visitor.visitSingularInt32Field(value: self.port, fieldNumber: 2) + } + if !self.nodeID.isEmpty { + try visitor.visitSingularBytesField(value: self.nodeID, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Endpoint, rhs: Protocol_Endpoint) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.port != rhs.port {return false} + if lhs.nodeID != rhs.nodeID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_PingMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PingMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "from"), + 2: .same(proto: "to"), + 3: .same(proto: "version"), + 4: .same(proto: "timestamp"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._from) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._to) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.version) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._from { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._to { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if self.version != 0 { + try visitor.visitSingularInt32Field(value: self.version, fieldNumber: 3) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_PingMessage, rhs: Protocol_PingMessage) -> Bool { + if lhs._from != rhs._from {return false} + if lhs._to != rhs._to {return false} + if lhs.version != rhs.version {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_PongMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PongMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "from"), + 2: .same(proto: "echo"), + 3: .same(proto: "timestamp"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._from) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.echo) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._from { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.echo != 0 { + try visitor.visitSingularInt32Field(value: self.echo, fieldNumber: 2) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_PongMessage, rhs: Protocol_PongMessage) -> Bool { + if lhs._from != rhs._from {return false} + if lhs.echo != rhs.echo {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_FindNeighbours: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FindNeighbours" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "from"), + 2: .same(proto: "targetId"), + 3: .same(proto: "timestamp"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._from) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.targetID) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._from { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.targetID.isEmpty { + try visitor.visitSingularBytesField(value: self.targetID, fieldNumber: 2) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_FindNeighbours, rhs: Protocol_FindNeighbours) -> Bool { + if lhs._from != rhs._from {return false} + if lhs.targetID != rhs.targetID {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Neighbours: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Neighbours" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "from"), + 2: .same(proto: "neighbours"), + 3: .same(proto: "timestamp"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._from) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.neighbours) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._from { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.neighbours.isEmpty { + try visitor.visitRepeatedMessageField(value: self.neighbours, fieldNumber: 2) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Neighbours, rhs: Protocol_Neighbours) -> Bool { + if lhs._from != rhs._from {return false} + if lhs.neighbours != rhs.neighbours {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BackupMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BackupMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "flag"), + 2: .same(proto: "priority"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.flag) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.priority) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.flag != false { + try visitor.visitSingularBoolField(value: self.flag, fieldNumber: 1) + } + if self.priority != 0 { + try visitor.visitSingularInt32Field(value: self.priority, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BackupMessage, rhs: Protocol_BackupMessage) -> Bool { + if lhs.flag != rhs.flag {return false} + if lhs.priority != rhs.priority {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/Tron Protobuf.md b/BlockchainSdk/Blockchains/Tron/protobuf/Tron Protobuf.md deleted file mode 100644 index 3eebd1bc9..000000000 --- a/BlockchainSdk/Blockchains/Tron/protobuf/Tron Protobuf.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tron Protobuf - -Tron.proto is taken from here: -https://github.com/tronprotocol/protocol/blob/master/core - -Contracts.proto is a compilation consistent of protobufs from the following files: -https://github.com/tronprotocol/protocol/blob/master/core/contract/balance_contract.proto -https://github.com/tronprotocol/protocol/blob/master/core/contract/smart_contract.proto - -DO NOT rename the 'package' property. If you do the serialisation will change and the runtime will stop accepting the transactions. - -The WalletCore's protobuf files do not have the Transaction message, that's why the Tron sources were picked. diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/Tron.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/Tron.pb.swift index 84c5a1eaf..5ada48ecb 100644 --- a/BlockchainSdk/Blockchains/Tron/protobuf/Tron.pb.swift +++ b/BlockchainSdk/Blockchains/Tron/protobuf/Tron.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: Tron.proto +// Source: core/Tron.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ @@ -20,7 +20,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP typealias Version = _2 } -enum Protocol_AccountType: SwiftProtobuf.Enum { +enum Protocol_AccountType: SwiftProtobuf.Enum, Swift.CaseIterable { typealias RawValue = Int case normal // = 0 case assetIssue // = 1 @@ -49,23 +49,155 @@ enum Protocol_AccountType: SwiftProtobuf.Enum { } } -} - -#if swift(>=4.2) - -extension Protocol_AccountType: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Protocol_AccountType] = [ + static let allCases: [Protocol_AccountType] = [ .normal, .assetIssue, .contract, ] + } -#endif // swift(>=4.2) +enum Protocol_ReasonCode: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case requested // = 0 + case badProtocol // = 2 + case tooManyPeers // = 4 + case duplicatePeer // = 5 + case incompatibleProtocol // = 6 + case randomElimination // = 7 + case peerQuiting // = 8 + case unexpectedIdentity // = 9 + case localIdentity // = 10 + case pingTimeout // = 11 + case userReason // = 16 + case reset // = 17 + case syncFail // = 18 + case fetchFail // = 19 + case badTx // = 20 + case badBlock // = 21 + case forked // = 22 + case unlinkable // = 23 + case incompatibleVersion // = 24 + case incompatibleChain // = 25 + case timeOut // = 32 + case connectFail // = 33 + case tooManyPeersWithSameIp // = 34 + case lightNodeSyncFail // = 35 + case belowThanMe // = 36 + case notWitness // = 37 + case noSuchMessage // = 38 + case unknown // = 255 + case UNRECOGNIZED(Int) + + init() { + self = .requested + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .requested + case 2: self = .badProtocol + case 4: self = .tooManyPeers + case 5: self = .duplicatePeer + case 6: self = .incompatibleProtocol + case 7: self = .randomElimination + case 8: self = .peerQuiting + case 9: self = .unexpectedIdentity + case 10: self = .localIdentity + case 11: self = .pingTimeout + case 16: self = .userReason + case 17: self = .reset + case 18: self = .syncFail + case 19: self = .fetchFail + case 20: self = .badTx + case 21: self = .badBlock + case 22: self = .forked + case 23: self = .unlinkable + case 24: self = .incompatibleVersion + case 25: self = .incompatibleChain + case 32: self = .timeOut + case 33: self = .connectFail + case 34: self = .tooManyPeersWithSameIp + case 35: self = .lightNodeSyncFail + case 36: self = .belowThanMe + case 37: self = .notWitness + case 38: self = .noSuchMessage + case 255: self = .unknown + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .requested: return 0 + case .badProtocol: return 2 + case .tooManyPeers: return 4 + case .duplicatePeer: return 5 + case .incompatibleProtocol: return 6 + case .randomElimination: return 7 + case .peerQuiting: return 8 + case .unexpectedIdentity: return 9 + case .localIdentity: return 10 + case .pingTimeout: return 11 + case .userReason: return 16 + case .reset: return 17 + case .syncFail: return 18 + case .fetchFail: return 19 + case .badTx: return 20 + case .badBlock: return 21 + case .forked: return 22 + case .unlinkable: return 23 + case .incompatibleVersion: return 24 + case .incompatibleChain: return 25 + case .timeOut: return 32 + case .connectFail: return 33 + case .tooManyPeersWithSameIp: return 34 + case .lightNodeSyncFail: return 35 + case .belowThanMe: return 36 + case .notWitness: return 37 + case .noSuchMessage: return 38 + case .unknown: return 255 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_ReasonCode] = [ + .requested, + .badProtocol, + .tooManyPeers, + .duplicatePeer, + .incompatibleProtocol, + .randomElimination, + .peerQuiting, + .unexpectedIdentity, + .localIdentity, + .pingTimeout, + .userReason, + .reset, + .syncFail, + .fetchFail, + .badTx, + .badBlock, + .forked, + .unlinkable, + .incompatibleVersion, + .incompatibleChain, + .timeOut, + .connectFail, + .tooManyPeersWithSameIp, + .lightNodeSyncFail, + .belowThanMe, + .notWitness, + .noSuchMessage, + .unknown, + ] + +} /// AccountId, (name, address) use name, (null, address) use address, (name, null) use name, -struct Protocol_AccountId { +struct Protocol_AccountId: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -79,511 +211,310 @@ struct Protocol_AccountId { init() {} } -struct Protocol_authority { +/// vote message +struct Protocol_Vote: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var account: Protocol_AccountId { - get {return _account ?? Protocol_AccountId()} - set {_account = newValue} - } - /// Returns true if `account` has been explicitly set. - var hasAccount: Bool {return self._account != nil} - /// Clears the value of `account`. Subsequent reads from it will return its default value. - mutating func clearAccount() {self._account = nil} + /// the super rep address + var voteAddress: Data = Data() - var permissionName: Data = Data() + /// the vote num to this super rep. + var voteCount: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - - fileprivate var _account: Protocol_AccountId? = nil } -struct Protocol_MarketOrderDetail { +/// Proposal +struct Protocol_Proposal: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var makerOrderID: Data = Data() + var proposalID: Int64 = 0 - var takerOrderID: Data = Data() + var proposerAddress: Data = Data() - var fillSellQuantity: Int64 = 0 + var parameters: Dictionary = [:] - var fillBuyQuantity: Int64 = 0 + var expirationTime: Int64 = 0 + + var createTime: Int64 = 0 + + var approvals: [Data] = [] + + var state: Protocol_Proposal.State = .pending var unknownFields = SwiftProtobuf.UnknownStorage() + enum State: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case pending // = 0 + case disapproved // = 1 + case approved // = 2 + case canceled // = 3 + case UNRECOGNIZED(Int) + + init() { + self = .pending + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .pending + case 1: self = .disapproved + case 2: self = .approved + case 3: self = .canceled + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .pending: return 0 + case .disapproved: return 1 + case .approved: return 2 + case .canceled: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Proposal.State] = [ + .pending, + .disapproved, + .approved, + .canceled, + ] + + } + init() {} } -struct Protocol_Transaction { +/// Exchange +struct Protocol_Exchange: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var rawData: Protocol_Transaction.raw { - get {return _rawData ?? Protocol_Transaction.raw()} - set {_rawData = newValue} - } - /// Returns true if `rawData` has been explicitly set. - var hasRawData: Bool {return self._rawData != nil} - /// Clears the value of `rawData`. Subsequent reads from it will return its default value. - mutating func clearRawData() {self._rawData = nil} - - /// only support size = 1, repeated list here for muti-sig extension - var signature: [Data] = [] + var exchangeID: Int64 = 0 - var ret: [Protocol_Transaction.Result] = [] + var creatorAddress: Data = Data() - var unknownFields = SwiftProtobuf.UnknownStorage() + var createTime: Int64 = 0 - struct Contract { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var firstTokenID: Data = Data() - var type: Protocol_Transaction.Contract.ContractType = .accountCreateContract + var firstTokenBalance: Int64 = 0 - var parameter: SwiftProtobuf.Google_Protobuf_Any { - get {return _parameter ?? SwiftProtobuf.Google_Protobuf_Any()} - set {_parameter = newValue} - } - /// Returns true if `parameter` has been explicitly set. - var hasParameter: Bool {return self._parameter != nil} - /// Clears the value of `parameter`. Subsequent reads from it will return its default value. - mutating func clearParameter() {self._parameter = nil} + var secondTokenID: Data = Data() - var provider: Data = Data() + var secondTokenBalance: Int64 = 0 - var contractName: Data = Data() + var unknownFields = SwiftProtobuf.UnknownStorage() - var permissionID: Int32 = 0 + init() {} +} - var unknownFields = SwiftProtobuf.UnknownStorage() +/// market +struct Protocol_MarketOrder: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - enum ContractType: SwiftProtobuf.Enum { - typealias RawValue = Int - case accountCreateContract // = 0 - case transferContract // = 1 - case transferAssetContract // = 2 - case voteAssetContract // = 3 - case voteWitnessContract // = 4 - case witnessCreateContract // = 5 - case assetIssueContract // = 6 - case witnessUpdateContract // = 8 - case participateAssetIssueContract // = 9 - case accountUpdateContract // = 10 - case freezeBalanceContract // = 11 - case unfreezeBalanceContract // = 12 - case withdrawBalanceContract // = 13 - case unfreezeAssetContract // = 14 - case updateAssetContract // = 15 - case proposalCreateContract // = 16 - case proposalApproveContract // = 17 - case proposalDeleteContract // = 18 - case setAccountIDContract // = 19 - case customContract // = 20 - case createSmartContract // = 30 - case triggerSmartContract // = 31 - case getContract // = 32 - case updateSettingContract // = 33 - case exchangeCreateContract // = 41 - case exchangeInjectContract // = 42 - case exchangeWithdrawContract // = 43 - case exchangeTransactionContract // = 44 - case updateEnergyLimitContract // = 45 - case accountPermissionUpdateContract // = 46 - case clearAbicontract // = 48 - case updateBrokerageContract // = 49 - case shieldedTransferContract // = 51 - case marketSellAssetContract // = 52 - case marketCancelOrderContract // = 53 - case UNRECOGNIZED(Int) + var orderID: Data = Data() - init() { - self = .accountCreateContract - } + var ownerAddress: Data = Data() - init?(rawValue: Int) { - switch rawValue { - case 0: self = .accountCreateContract - case 1: self = .transferContract - case 2: self = .transferAssetContract - case 3: self = .voteAssetContract - case 4: self = .voteWitnessContract - case 5: self = .witnessCreateContract - case 6: self = .assetIssueContract - case 8: self = .witnessUpdateContract - case 9: self = .participateAssetIssueContract - case 10: self = .accountUpdateContract - case 11: self = .freezeBalanceContract - case 12: self = .unfreezeBalanceContract - case 13: self = .withdrawBalanceContract - case 14: self = .unfreezeAssetContract - case 15: self = .updateAssetContract - case 16: self = .proposalCreateContract - case 17: self = .proposalApproveContract - case 18: self = .proposalDeleteContract - case 19: self = .setAccountIDContract - case 20: self = .customContract - case 30: self = .createSmartContract - case 31: self = .triggerSmartContract - case 32: self = .getContract - case 33: self = .updateSettingContract - case 41: self = .exchangeCreateContract - case 42: self = .exchangeInjectContract - case 43: self = .exchangeWithdrawContract - case 44: self = .exchangeTransactionContract - case 45: self = .updateEnergyLimitContract - case 46: self = .accountPermissionUpdateContract - case 48: self = .clearAbicontract - case 49: self = .updateBrokerageContract - case 51: self = .shieldedTransferContract - case 52: self = .marketSellAssetContract - case 53: self = .marketCancelOrderContract - default: self = .UNRECOGNIZED(rawValue) - } - } + var createTime: Int64 = 0 - var rawValue: Int { - switch self { - case .accountCreateContract: return 0 - case .transferContract: return 1 - case .transferAssetContract: return 2 - case .voteAssetContract: return 3 - case .voteWitnessContract: return 4 - case .witnessCreateContract: return 5 - case .assetIssueContract: return 6 - case .witnessUpdateContract: return 8 - case .participateAssetIssueContract: return 9 - case .accountUpdateContract: return 10 - case .freezeBalanceContract: return 11 - case .unfreezeBalanceContract: return 12 - case .withdrawBalanceContract: return 13 - case .unfreezeAssetContract: return 14 - case .updateAssetContract: return 15 - case .proposalCreateContract: return 16 - case .proposalApproveContract: return 17 - case .proposalDeleteContract: return 18 - case .setAccountIDContract: return 19 - case .customContract: return 20 - case .createSmartContract: return 30 - case .triggerSmartContract: return 31 - case .getContract: return 32 - case .updateSettingContract: return 33 - case .exchangeCreateContract: return 41 - case .exchangeInjectContract: return 42 - case .exchangeWithdrawContract: return 43 - case .exchangeTransactionContract: return 44 - case .updateEnergyLimitContract: return 45 - case .accountPermissionUpdateContract: return 46 - case .clearAbicontract: return 48 - case .updateBrokerageContract: return 49 - case .shieldedTransferContract: return 51 - case .marketSellAssetContract: return 52 - case .marketCancelOrderContract: return 53 - case .UNRECOGNIZED(let i): return i - } - } + var sellTokenID: Data = Data() - } + var sellTokenQuantity: Int64 = 0 - init() {} + var buyTokenID: Data = Data() - fileprivate var _parameter: SwiftProtobuf.Google_Protobuf_Any? = nil - } + /// min to receive + var buyTokenQuantity: Int64 = 0 - struct Result { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. + var sellTokenQuantityRemain: Int64 = 0 - var fee: Int64 = 0 + /// When state != ACTIVE and sell_token_quantity_return !=0, + ///it means that some sell tokens are returned to the account due to insufficient remaining amount + var sellTokenQuantityReturn: Int64 = 0 - var ret: Protocol_Transaction.Result.code = .sucess + var state: Protocol_MarketOrder.State = .active - var contractRet: Protocol_Transaction.Result.contractResult = .default + var prev: Data = Data() - var assetIssueID: String = String() + var next: Data = Data() - var withdrawAmount: Int64 = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() - var unfreezeAmount: Int64 = 0 + enum State: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case active // = 0 + case inactive // = 1 + case canceled // = 2 + case UNRECOGNIZED(Int) - var exchangeReceivedAmount: Int64 = 0 + init() { + self = .active + } - var exchangeInjectAnotherAmount: Int64 = 0 + init?(rawValue: Int) { + switch rawValue { + case 0: self = .active + case 1: self = .inactive + case 2: self = .canceled + default: self = .UNRECOGNIZED(rawValue) + } + } - var exchangeWithdrawAnotherAmount: Int64 = 0 + var rawValue: Int { + switch self { + case .active: return 0 + case .inactive: return 1 + case .canceled: return 2 + case .UNRECOGNIZED(let i): return i + } + } - var exchangeID: Int64 = 0 + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_MarketOrder.State] = [ + .active, + .inactive, + .canceled, + ] - var shieldedTransactionFee: Int64 = 0 + } - var orderID: Data = Data() + init() {} +} - var orderDetails: [Protocol_MarketOrderDetail] = [] +struct Protocol_MarketOrderList: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var unknownFields = SwiftProtobuf.UnknownStorage() + var orders: [Protocol_MarketOrder] = [] - enum code: SwiftProtobuf.Enum { - typealias RawValue = Int - case sucess // = 0 - case failed // = 1 - case UNRECOGNIZED(Int) + var unknownFields = SwiftProtobuf.UnknownStorage() - init() { - self = .sucess - } + init() {} +} - init?(rawValue: Int) { - switch rawValue { - case 0: self = .sucess - case 1: self = .failed - default: self = .UNRECOGNIZED(rawValue) - } - } +struct Protocol_MarketOrderPairList: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var rawValue: Int { - switch self { - case .sucess: return 0 - case .failed: return 1 - case .UNRECOGNIZED(let i): return i - } - } + var orderPair: [Protocol_MarketOrderPair] = [] - } + var unknownFields = SwiftProtobuf.UnknownStorage() - enum contractResult: SwiftProtobuf.Enum { - typealias RawValue = Int - case `default` // = 0 - case success // = 1 - case revert // = 2 - case badJumpDestination // = 3 - case outOfMemory // = 4 - case precompiledContract // = 5 - case stackTooSmall // = 6 - case stackTooLarge // = 7 - case illegalOperation // = 8 - case stackOverflow // = 9 - case outOfEnergy // = 10 - case outOfTime // = 11 - case jvmStackOverFlow // = 12 - case unknown // = 13 - case transferFailed // = 14 - case invalidCode // = 15 - case UNRECOGNIZED(Int) + init() {} +} - init() { - self = .default - } +struct Protocol_MarketOrderPair: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .success - case 2: self = .revert - case 3: self = .badJumpDestination - case 4: self = .outOfMemory - case 5: self = .precompiledContract - case 6: self = .stackTooSmall - case 7: self = .stackTooLarge - case 8: self = .illegalOperation - case 9: self = .stackOverflow - case 10: self = .outOfEnergy - case 11: self = .outOfTime - case 12: self = .jvmStackOverFlow - case 13: self = .unknown - case 14: self = .transferFailed - case 15: self = .invalidCode - default: self = .UNRECOGNIZED(rawValue) - } - } + var sellTokenID: Data = Data() - var rawValue: Int { - switch self { - case .default: return 0 - case .success: return 1 - case .revert: return 2 - case .badJumpDestination: return 3 - case .outOfMemory: return 4 - case .precompiledContract: return 5 - case .stackTooSmall: return 6 - case .stackTooLarge: return 7 - case .illegalOperation: return 8 - case .stackOverflow: return 9 - case .outOfEnergy: return 10 - case .outOfTime: return 11 - case .jvmStackOverFlow: return 12 - case .unknown: return 13 - case .transferFailed: return 14 - case .invalidCode: return 15 - case .UNRECOGNIZED(let i): return i - } - } + var buyTokenID: Data = Data() - } + var unknownFields = SwiftProtobuf.UnknownStorage() - init() {} - } + init() {} +} - struct raw { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. +struct Protocol_MarketAccountOrder: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var refBlockBytes: Data = Data() + var ownerAddress: Data = Data() - var refBlockNum: Int64 = 0 + /// order_id list + var orders: [Data] = [] - var refBlockHash: Data = Data() + /// active count + var count: Int64 = 0 - var expiration: Int64 = 0 + var totalCount: Int64 = 0 - var auths: [Protocol_authority] = [] + var unknownFields = SwiftProtobuf.UnknownStorage() - /// data not used - var data: Data = Data() + init() {} +} - ///only support size = 1, repeated list here for extension - var contract: [Protocol_Transaction.Contract] = [] +struct Protocol_MarketPrice: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - /// scripts not used - var scripts: Data = Data() + var sellTokenQuantity: Int64 = 0 - var timestamp: Int64 = 0 + var buyTokenQuantity: Int64 = 0 - var feeLimit: Int64 = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() - var unknownFields = SwiftProtobuf.UnknownStorage() + init() {} +} - init() {} - } +struct Protocol_MarketPriceList: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - init() {} + var sellTokenID: Data = Data() - fileprivate var _rawData: Protocol_Transaction.raw? = nil -} + var buyTokenID: Data = Data() -#if swift(>=4.2) + var prices: [Protocol_MarketPrice] = [] -extension Protocol_Transaction.Contract.ContractType: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Protocol_Transaction.Contract.ContractType] = [ - .accountCreateContract, - .transferContract, - .transferAssetContract, - .voteAssetContract, - .voteWitnessContract, - .witnessCreateContract, - .assetIssueContract, - .witnessUpdateContract, - .participateAssetIssueContract, - .accountUpdateContract, - .freezeBalanceContract, - .unfreezeBalanceContract, - .withdrawBalanceContract, - .unfreezeAssetContract, - .updateAssetContract, - .proposalCreateContract, - .proposalApproveContract, - .proposalDeleteContract, - .setAccountIDContract, - .customContract, - .createSmartContract, - .triggerSmartContract, - .getContract, - .updateSettingContract, - .exchangeCreateContract, - .exchangeInjectContract, - .exchangeWithdrawContract, - .exchangeTransactionContract, - .updateEnergyLimitContract, - .accountPermissionUpdateContract, - .clearAbicontract, - .updateBrokerageContract, - .shieldedTransferContract, - .marketSellAssetContract, - .marketCancelOrderContract, - ] -} - -extension Protocol_Transaction.Result.code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Protocol_Transaction.Result.code] = [ - .sucess, - .failed, - ] -} + var unknownFields = SwiftProtobuf.UnknownStorage() -extension Protocol_Transaction.Result.contractResult: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - static var allCases: [Protocol_Transaction.Result.contractResult] = [ - .default, - .success, - .revert, - .badJumpDestination, - .outOfMemory, - .precompiledContract, - .stackTooSmall, - .stackTooLarge, - .illegalOperation, - .stackOverflow, - .outOfEnergy, - .outOfTime, - .jvmStackOverFlow, - .unknown, - .transferFailed, - .invalidCode, - ] + init() {} } -#endif // swift(>=4.2) - -struct Protocol_BlockHeader { +struct Protocol_MarketOrderIdList: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var rawData: Protocol_BlockHeader.raw { - get {return _rawData ?? Protocol_BlockHeader.raw()} - set {_rawData = newValue} - } - /// Returns true if `rawData` has been explicitly set. - var hasRawData: Bool {return self._rawData != nil} - /// Clears the value of `rawData`. Subsequent reads from it will return its default value. - mutating func clearRawData() {self._rawData = nil} + var head: Data = Data() - var witnessSignature: Data = Data() + var tail: Data = Data() var unknownFields = SwiftProtobuf.UnknownStorage() - struct raw { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var timestamp: Int64 = 0 - - var txTrieRoot: Data = Data() + init() {} +} - var parentHash: Data = Data() +struct Protocol_ChainParameters: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - ///bytes nonce = 5; - ///bytes difficulty = 6; - var number: Int64 = 0 + var chainParameter: [Protocol_ChainParameters.ChainParameter] = [] - var witnessID: Int64 = 0 + var unknownFields = SwiftProtobuf.UnknownStorage() - var witnessAddress: Data = Data() + struct ChainParameter: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. - var version: Int32 = 0 + var key: String = String() - var accountStateRoot: Data = Data() + var value: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() @@ -591,68 +522,7397 @@ struct Protocol_BlockHeader { } init() {} - - fileprivate var _rawData: Protocol_BlockHeader.raw? = nil } -/// block -struct Protocol_Block { +/// Account +struct Protocol_Account: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - var transactions: [Protocol_Transaction] = [] + /// account nick name + var accountName: Data { + get {return _storage._accountName} + set {_uniqueStorage()._accountName = newValue} + } - var blockHeader: Protocol_BlockHeader { - get {return _blockHeader ?? Protocol_BlockHeader()} - set {_blockHeader = newValue} + var type: Protocol_AccountType { + get {return _storage._type} + set {_uniqueStorage()._type = newValue} } - /// Returns true if `blockHeader` has been explicitly set. - var hasBlockHeader: Bool {return self._blockHeader != nil} - /// Clears the value of `blockHeader`. Subsequent reads from it will return its default value. - mutating func clearBlockHeader() {self._blockHeader = nil} - var unknownFields = SwiftProtobuf.UnknownStorage() + /// the create address + var address: Data { + get {return _storage._address} + set {_uniqueStorage()._address = newValue} + } - init() {} + /// the trx balance + var balance: Int64 { + get {return _storage._balance} + set {_uniqueStorage()._balance = newValue} + } - fileprivate var _blockHeader: Protocol_BlockHeader? = nil -} + /// the votes + var votes: [Protocol_Vote] { + get {return _storage._votes} + set {_uniqueStorage()._votes = newValue} + } + + /// the other asset owned by this account + var asset: Dictionary { + get {return _storage._asset} + set {_uniqueStorage()._asset = newValue} + } + + /// the other asset owned by this account,key is assetId + var assetV2: Dictionary { + get {return _storage._assetV2} + set {_uniqueStorage()._assetV2 = newValue} + } + + /// the frozen balance for bandwidth + var frozen: [Protocol_Account.Frozen] { + get {return _storage._frozen} + set {_uniqueStorage()._frozen = newValue} + } + + /// bandwidth, get from frozen + var netUsage: Int64 { + get {return _storage._netUsage} + set {_uniqueStorage()._netUsage = newValue} + } + + ///Frozen balance provided by other accounts to this account + var acquiredDelegatedFrozenBalanceForBandwidth: Int64 { + get {return _storage._acquiredDelegatedFrozenBalanceForBandwidth} + set {_uniqueStorage()._acquiredDelegatedFrozenBalanceForBandwidth = newValue} + } + + ///Freeze and provide balances to other accounts + var delegatedFrozenBalanceForBandwidth: Int64 { + get {return _storage._delegatedFrozenBalanceForBandwidth} + set {_uniqueStorage()._delegatedFrozenBalanceForBandwidth = newValue} + } + + var oldTronPower: Int64 { + get {return _storage._oldTronPower} + set {_uniqueStorage()._oldTronPower = newValue} + } + + var tronPower: Protocol_Account.Frozen { + get {return _storage._tronPower ?? Protocol_Account.Frozen()} + set {_uniqueStorage()._tronPower = newValue} + } + /// Returns true if `tronPower` has been explicitly set. + var hasTronPower: Bool {return _storage._tronPower != nil} + /// Clears the value of `tronPower`. Subsequent reads from it will return its default value. + mutating func clearTronPower() {_uniqueStorage()._tronPower = nil} + + var assetOptimized: Bool { + get {return _storage._assetOptimized} + set {_uniqueStorage()._assetOptimized = newValue} + } + + /// this account create time + var createTime: Int64 { + get {return _storage._createTime} + set {_uniqueStorage()._createTime = newValue} + } + + /// this last operation time, including transfer, voting and so on. //FIXME fix grammar + var latestOprationTime: Int64 { + get {return _storage._latestOprationTime} + set {_uniqueStorage()._latestOprationTime = newValue} + } + + /// witness block producing allowance + var allowance: Int64 { + get {return _storage._allowance} + set {_uniqueStorage()._allowance = newValue} + } + + /// last withdraw time + var latestWithdrawTime: Int64 { + get {return _storage._latestWithdrawTime} + set {_uniqueStorage()._latestWithdrawTime = newValue} + } + + /// not used so far + var code: Data { + get {return _storage._code} + set {_uniqueStorage()._code = newValue} + } + + var isWitness: Bool { + get {return _storage._isWitness} + set {_uniqueStorage()._isWitness = newValue} + } + + var isCommittee: Bool { + get {return _storage._isCommittee} + set {_uniqueStorage()._isCommittee = newValue} + } + + /// frozen asset(for asset issuer) + var frozenSupply: [Protocol_Account.Frozen] { + get {return _storage._frozenSupply} + set {_uniqueStorage()._frozenSupply = newValue} + } -#if swift(>=5.5) && canImport(_Concurrency) -extension Protocol_AccountType: @unchecked Sendable {} -extension Protocol_AccountId: @unchecked Sendable {} -extension Protocol_authority: @unchecked Sendable {} -extension Protocol_MarketOrderDetail: @unchecked Sendable {} -extension Protocol_Transaction: @unchecked Sendable {} -extension Protocol_Transaction.Contract: @unchecked Sendable {} -extension Protocol_Transaction.Contract.ContractType: @unchecked Sendable {} -extension Protocol_Transaction.Result: @unchecked Sendable {} -extension Protocol_Transaction.Result.code: @unchecked Sendable {} -extension Protocol_Transaction.Result.contractResult: @unchecked Sendable {} -extension Protocol_Transaction.raw: @unchecked Sendable {} -extension Protocol_BlockHeader: @unchecked Sendable {} -extension Protocol_BlockHeader.raw: @unchecked Sendable {} -extension Protocol_Block: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) + /// asset_issued_name + var assetIssuedName: Data { + get {return _storage._assetIssuedName} + set {_uniqueStorage()._assetIssuedName = newValue} + } + + var assetIssuedID: Data { + get {return _storage._assetIssuedID} + set {_uniqueStorage()._assetIssuedID = newValue} + } + + var latestAssetOperationTime: Dictionary { + get {return _storage._latestAssetOperationTime} + set {_uniqueStorage()._latestAssetOperationTime = newValue} + } + + var latestAssetOperationTimeV2: Dictionary { + get {return _storage._latestAssetOperationTimeV2} + set {_uniqueStorage()._latestAssetOperationTimeV2 = newValue} + } + + var freeNetUsage: Int64 { + get {return _storage._freeNetUsage} + set {_uniqueStorage()._freeNetUsage = newValue} + } + + var freeAssetNetUsage: Dictionary { + get {return _storage._freeAssetNetUsage} + set {_uniqueStorage()._freeAssetNetUsage = newValue} + } + + var freeAssetNetUsageV2: Dictionary { + get {return _storage._freeAssetNetUsageV2} + set {_uniqueStorage()._freeAssetNetUsageV2 = newValue} + } + + var latestConsumeTime: Int64 { + get {return _storage._latestConsumeTime} + set {_uniqueStorage()._latestConsumeTime = newValue} + } + + var latestConsumeFreeTime: Int64 { + get {return _storage._latestConsumeFreeTime} + set {_uniqueStorage()._latestConsumeFreeTime = newValue} + } + + /// the identity of this account, case insensitive + var accountID: Data { + get {return _storage._accountID} + set {_uniqueStorage()._accountID = newValue} + } + + var netWindowSize: Int64 { + get {return _storage._netWindowSize} + set {_uniqueStorage()._netWindowSize = newValue} + } + + var netWindowOptimized: Bool { + get {return _storage._netWindowOptimized} + set {_uniqueStorage()._netWindowOptimized = newValue} + } + + var accountResource: Protocol_Account.AccountResource { + get {return _storage._accountResource ?? Protocol_Account.AccountResource()} + set {_uniqueStorage()._accountResource = newValue} + } + /// Returns true if `accountResource` has been explicitly set. + var hasAccountResource: Bool {return _storage._accountResource != nil} + /// Clears the value of `accountResource`. Subsequent reads from it will return its default value. + mutating func clearAccountResource() {_uniqueStorage()._accountResource = nil} + + var codeHash: Data { + get {return _storage._codeHash} + set {_uniqueStorage()._codeHash = newValue} + } + + var ownerPermission: Protocol_Permission { + get {return _storage._ownerPermission ?? Protocol_Permission()} + set {_uniqueStorage()._ownerPermission = newValue} + } + /// Returns true if `ownerPermission` has been explicitly set. + var hasOwnerPermission: Bool {return _storage._ownerPermission != nil} + /// Clears the value of `ownerPermission`. Subsequent reads from it will return its default value. + mutating func clearOwnerPermission() {_uniqueStorage()._ownerPermission = nil} + + var witnessPermission: Protocol_Permission { + get {return _storage._witnessPermission ?? Protocol_Permission()} + set {_uniqueStorage()._witnessPermission = newValue} + } + /// Returns true if `witnessPermission` has been explicitly set. + var hasWitnessPermission: Bool {return _storage._witnessPermission != nil} + /// Clears the value of `witnessPermission`. Subsequent reads from it will return its default value. + mutating func clearWitnessPermission() {_uniqueStorage()._witnessPermission = nil} + + var activePermission: [Protocol_Permission] { + get {return _storage._activePermission} + set {_uniqueStorage()._activePermission = newValue} + } + + var frozenV2: [Protocol_Account.FreezeV2] { + get {return _storage._frozenV2} + set {_uniqueStorage()._frozenV2 = newValue} + } + + var unfrozenV2: [Protocol_Account.UnFreezeV2] { + get {return _storage._unfrozenV2} + set {_uniqueStorage()._unfrozenV2 = newValue} + } + + var delegatedFrozenV2BalanceForBandwidth: Int64 { + get {return _storage._delegatedFrozenV2BalanceForBandwidth} + set {_uniqueStorage()._delegatedFrozenV2BalanceForBandwidth = newValue} + } + + var acquiredDelegatedFrozenV2BalanceForBandwidth: Int64 { + get {return _storage._acquiredDelegatedFrozenV2BalanceForBandwidth} + set {_uniqueStorage()._acquiredDelegatedFrozenV2BalanceForBandwidth = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// frozen balance + struct Frozen: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// the frozen trx balance + var frozenBalance: Int64 = 0 + + /// the expire time + var expireTime: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct AccountResource: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// energy resource, get from frozen + var energyUsage: Int64 = 0 + + /// the frozen balance for energy + var frozenBalanceForEnergy: Protocol_Account.Frozen { + get {return _frozenBalanceForEnergy ?? Protocol_Account.Frozen()} + set {_frozenBalanceForEnergy = newValue} + } + /// Returns true if `frozenBalanceForEnergy` has been explicitly set. + var hasFrozenBalanceForEnergy: Bool {return self._frozenBalanceForEnergy != nil} + /// Clears the value of `frozenBalanceForEnergy`. Subsequent reads from it will return its default value. + mutating func clearFrozenBalanceForEnergy() {self._frozenBalanceForEnergy = nil} + + var latestConsumeTimeForEnergy: Int64 = 0 + + ///Frozen balance provided by other accounts to this account + var acquiredDelegatedFrozenBalanceForEnergy: Int64 = 0 + + ///Frozen balances provided to other accounts + var delegatedFrozenBalanceForEnergy: Int64 = 0 + + /// storage resource, get from market + var storageLimit: Int64 = 0 + + var storageUsage: Int64 = 0 + + var latestExchangeStorageTime: Int64 = 0 + + var energyWindowSize: Int64 = 0 + + var delegatedFrozenV2BalanceForEnergy: Int64 = 0 + + var acquiredDelegatedFrozenV2BalanceForEnergy: Int64 = 0 + + var energyWindowOptimized: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _frozenBalanceForEnergy: Protocol_Account.Frozen? = nil + } + + struct FreezeV2: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Protocol_ResourceCode = .bandwidth + + var amount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct UnFreezeV2: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Protocol_ResourceCode = .bandwidth + + var unfreezeAmount: Int64 = 0 + + var unfreezeExpireTime: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Protocol_Key: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: Data = Data() + + var weight: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_DelegatedResource: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var from: Data = Data() + + var to: Data = Data() + + var frozenBalanceForBandwidth: Int64 = 0 + + var frozenBalanceForEnergy: Int64 = 0 + + var expireTimeForBandwidth: Int64 = 0 + + var expireTimeForEnergy: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_authority: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var account: Protocol_AccountId { + get {return _account ?? Protocol_AccountId()} + set {_account = newValue} + } + /// Returns true if `account` has been explicitly set. + var hasAccount: Bool {return self._account != nil} + /// Clears the value of `account`. Subsequent reads from it will return its default value. + mutating func clearAccount() {self._account = nil} + + var permissionName: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _account: Protocol_AccountId? = nil +} + +struct Protocol_Permission: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Protocol_Permission.PermissionType = .owner + + ///Owner id=0, Witness id=1, Active id start by 2 + var id: Int32 = 0 + + var permissionName: String = String() + + var threshold: Int64 = 0 + + var parentID: Int32 = 0 + + ///1 bit 1 contract + var operations: Data = Data() + + var keys: [Protocol_Key] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum PermissionType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case owner // = 0 + case witness // = 1 + case active // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .owner + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .owner + case 1: self = .witness + case 2: self = .active + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .owner: return 0 + case .witness: return 1 + case .active: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Permission.PermissionType] = [ + .owner, + .witness, + .active, + ] + + } + + init() {} +} + +/// Witness +struct Protocol_Witness: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: Data = Data() + + var voteCount: Int64 = 0 + + var pubKey: Data = Data() + + var url: String = String() + + var totalProduced: Int64 = 0 + + var totalMissed: Int64 = 0 + + var latestBlockNum: Int64 = 0 + + var latestSlotNum: Int64 = 0 + + var isJobs: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Vote Change +struct Protocol_Votes: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: Data = Data() + + var oldVotes: [Protocol_Vote] = [] + + var newVotes: [Protocol_Vote] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_TXOutput: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var value: Int64 = 0 + + var pubKeyHash: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_TXInput: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var rawData: Protocol_TXInput.raw { + get {return _rawData ?? Protocol_TXInput.raw()} + set {_rawData = newValue} + } + /// Returns true if `rawData` has been explicitly set. + var hasRawData: Bool {return self._rawData != nil} + /// Clears the value of `rawData`. Subsequent reads from it will return its default value. + mutating func clearRawData() {self._rawData = nil} + + var signature: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct raw: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var txID: Data = Data() + + var vout: Int64 = 0 + + var pubKey: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _rawData: Protocol_TXInput.raw? = nil +} + +struct Protocol_TXOutputs: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var outputs: [Protocol_TXOutput] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ResourceReceipt: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var energyUsage: Int64 = 0 + + var energyFee: Int64 = 0 + + var originEnergyUsage: Int64 = 0 + + var energyUsageTotal: Int64 = 0 + + var netUsage: Int64 = 0 + + var netFee: Int64 = 0 + + var result: Protocol_Transaction.Result.contractResult = .default + + var energyPenaltyTotal: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_MarketOrderDetail: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var makerOrderID: Data = Data() + + var takerOrderID: Data = Data() + + var fillSellQuantity: Int64 = 0 + + var fillBuyQuantity: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_Transaction: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var rawData: Protocol_Transaction.raw { + get {return _rawData ?? Protocol_Transaction.raw()} + set {_rawData = newValue} + } + /// Returns true if `rawData` has been explicitly set. + var hasRawData: Bool {return self._rawData != nil} + /// Clears the value of `rawData`. Subsequent reads from it will return its default value. + mutating func clearRawData() {self._rawData = nil} + + /// only support size = 1, repeated list here for muti-sig extension + var signature: [Data] = [] + + var ret: [Protocol_Transaction.Result] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Contract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Protocol_Transaction.Contract.ContractType = .accountCreateContract + + var parameter: SwiftProtobuf.Google_Protobuf_Any { + get {return _parameter ?? SwiftProtobuf.Google_Protobuf_Any()} + set {_parameter = newValue} + } + /// Returns true if `parameter` has been explicitly set. + var hasParameter: Bool {return self._parameter != nil} + /// Clears the value of `parameter`. Subsequent reads from it will return its default value. + mutating func clearParameter() {self._parameter = nil} + + var provider: Data = Data() + + var contractName: Data = Data() + + var permissionID: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum ContractType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case accountCreateContract // = 0 + case transferContract // = 1 + case transferAssetContract // = 2 + case voteAssetContract // = 3 + case voteWitnessContract // = 4 + case witnessCreateContract // = 5 + case assetIssueContract // = 6 + case witnessUpdateContract // = 8 + case participateAssetIssueContract // = 9 + case accountUpdateContract // = 10 + case freezeBalanceContract // = 11 + case unfreezeBalanceContract // = 12 + case withdrawBalanceContract // = 13 + case unfreezeAssetContract // = 14 + case updateAssetContract // = 15 + case proposalCreateContract // = 16 + case proposalApproveContract // = 17 + case proposalDeleteContract // = 18 + case setAccountIDContract // = 19 + case customContract // = 20 + case createSmartContract // = 30 + case triggerSmartContract // = 31 + case getContract // = 32 + case updateSettingContract // = 33 + case exchangeCreateContract // = 41 + case exchangeInjectContract // = 42 + case exchangeWithdrawContract // = 43 + case exchangeTransactionContract // = 44 + case updateEnergyLimitContract // = 45 + case accountPermissionUpdateContract // = 46 + case clearAbicontract // = 48 + case updateBrokerageContract // = 49 + case shieldedTransferContract // = 51 + case marketSellAssetContract // = 52 + case marketCancelOrderContract // = 53 + case freezeBalanceV2Contract // = 54 + case unfreezeBalanceV2Contract // = 55 + case withdrawExpireUnfreezeContract // = 56 + case delegateResourceContract // = 57 + case unDelegateResourceContract // = 58 + case cancelAllUnfreezeV2Contract // = 59 + case UNRECOGNIZED(Int) + + init() { + self = .accountCreateContract + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .accountCreateContract + case 1: self = .transferContract + case 2: self = .transferAssetContract + case 3: self = .voteAssetContract + case 4: self = .voteWitnessContract + case 5: self = .witnessCreateContract + case 6: self = .assetIssueContract + case 8: self = .witnessUpdateContract + case 9: self = .participateAssetIssueContract + case 10: self = .accountUpdateContract + case 11: self = .freezeBalanceContract + case 12: self = .unfreezeBalanceContract + case 13: self = .withdrawBalanceContract + case 14: self = .unfreezeAssetContract + case 15: self = .updateAssetContract + case 16: self = .proposalCreateContract + case 17: self = .proposalApproveContract + case 18: self = .proposalDeleteContract + case 19: self = .setAccountIDContract + case 20: self = .customContract + case 30: self = .createSmartContract + case 31: self = .triggerSmartContract + case 32: self = .getContract + case 33: self = .updateSettingContract + case 41: self = .exchangeCreateContract + case 42: self = .exchangeInjectContract + case 43: self = .exchangeWithdrawContract + case 44: self = .exchangeTransactionContract + case 45: self = .updateEnergyLimitContract + case 46: self = .accountPermissionUpdateContract + case 48: self = .clearAbicontract + case 49: self = .updateBrokerageContract + case 51: self = .shieldedTransferContract + case 52: self = .marketSellAssetContract + case 53: self = .marketCancelOrderContract + case 54: self = .freezeBalanceV2Contract + case 55: self = .unfreezeBalanceV2Contract + case 56: self = .withdrawExpireUnfreezeContract + case 57: self = .delegateResourceContract + case 58: self = .unDelegateResourceContract + case 59: self = .cancelAllUnfreezeV2Contract + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .accountCreateContract: return 0 + case .transferContract: return 1 + case .transferAssetContract: return 2 + case .voteAssetContract: return 3 + case .voteWitnessContract: return 4 + case .witnessCreateContract: return 5 + case .assetIssueContract: return 6 + case .witnessUpdateContract: return 8 + case .participateAssetIssueContract: return 9 + case .accountUpdateContract: return 10 + case .freezeBalanceContract: return 11 + case .unfreezeBalanceContract: return 12 + case .withdrawBalanceContract: return 13 + case .unfreezeAssetContract: return 14 + case .updateAssetContract: return 15 + case .proposalCreateContract: return 16 + case .proposalApproveContract: return 17 + case .proposalDeleteContract: return 18 + case .setAccountIDContract: return 19 + case .customContract: return 20 + case .createSmartContract: return 30 + case .triggerSmartContract: return 31 + case .getContract: return 32 + case .updateSettingContract: return 33 + case .exchangeCreateContract: return 41 + case .exchangeInjectContract: return 42 + case .exchangeWithdrawContract: return 43 + case .exchangeTransactionContract: return 44 + case .updateEnergyLimitContract: return 45 + case .accountPermissionUpdateContract: return 46 + case .clearAbicontract: return 48 + case .updateBrokerageContract: return 49 + case .shieldedTransferContract: return 51 + case .marketSellAssetContract: return 52 + case .marketCancelOrderContract: return 53 + case .freezeBalanceV2Contract: return 54 + case .unfreezeBalanceV2Contract: return 55 + case .withdrawExpireUnfreezeContract: return 56 + case .delegateResourceContract: return 57 + case .unDelegateResourceContract: return 58 + case .cancelAllUnfreezeV2Contract: return 59 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Transaction.Contract.ContractType] = [ + .accountCreateContract, + .transferContract, + .transferAssetContract, + .voteAssetContract, + .voteWitnessContract, + .witnessCreateContract, + .assetIssueContract, + .witnessUpdateContract, + .participateAssetIssueContract, + .accountUpdateContract, + .freezeBalanceContract, + .unfreezeBalanceContract, + .withdrawBalanceContract, + .unfreezeAssetContract, + .updateAssetContract, + .proposalCreateContract, + .proposalApproveContract, + .proposalDeleteContract, + .setAccountIDContract, + .customContract, + .createSmartContract, + .triggerSmartContract, + .getContract, + .updateSettingContract, + .exchangeCreateContract, + .exchangeInjectContract, + .exchangeWithdrawContract, + .exchangeTransactionContract, + .updateEnergyLimitContract, + .accountPermissionUpdateContract, + .clearAbicontract, + .updateBrokerageContract, + .shieldedTransferContract, + .marketSellAssetContract, + .marketCancelOrderContract, + .freezeBalanceV2Contract, + .unfreezeBalanceV2Contract, + .withdrawExpireUnfreezeContract, + .delegateResourceContract, + .unDelegateResourceContract, + .cancelAllUnfreezeV2Contract, + ] + + } + + init() {} + + fileprivate var _parameter: SwiftProtobuf.Google_Protobuf_Any? = nil + } + + struct Result: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var fee: Int64 = 0 + + var ret: Protocol_Transaction.Result.code = .sucess + + var contractRet: Protocol_Transaction.Result.contractResult = .default + + var assetIssueID: String = String() + + var withdrawAmount: Int64 = 0 + + var unfreezeAmount: Int64 = 0 + + var exchangeReceivedAmount: Int64 = 0 + + var exchangeInjectAnotherAmount: Int64 = 0 + + var exchangeWithdrawAnotherAmount: Int64 = 0 + + var exchangeID: Int64 = 0 + + var shieldedTransactionFee: Int64 = 0 + + var orderID: Data = Data() + + var orderDetails: [Protocol_MarketOrderDetail] = [] + + var withdrawExpireAmount: Int64 = 0 + + var cancelUnfreezeV2Amount: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum code: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case sucess // = 0 + case failed // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .sucess + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .sucess + case 1: self = .failed + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .sucess: return 0 + case .failed: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Transaction.Result.code] = [ + .sucess, + .failed, + ] + + } + + enum contractResult: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case `default` // = 0 + case success // = 1 + case revert // = 2 + case badJumpDestination // = 3 + case outOfMemory // = 4 + case precompiledContract // = 5 + case stackTooSmall // = 6 + case stackTooLarge // = 7 + case illegalOperation // = 8 + case stackOverflow // = 9 + case outOfEnergy // = 10 + case outOfTime // = 11 + case jvmStackOverFlow // = 12 + case unknown // = 13 + case transferFailed // = 14 + case invalidCode // = 15 + case UNRECOGNIZED(Int) + + init() { + self = .default + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .default + case 1: self = .success + case 2: self = .revert + case 3: self = .badJumpDestination + case 4: self = .outOfMemory + case 5: self = .precompiledContract + case 6: self = .stackTooSmall + case 7: self = .stackTooLarge + case 8: self = .illegalOperation + case 9: self = .stackOverflow + case 10: self = .outOfEnergy + case 11: self = .outOfTime + case 12: self = .jvmStackOverFlow + case 13: self = .unknown + case 14: self = .transferFailed + case 15: self = .invalidCode + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .default: return 0 + case .success: return 1 + case .revert: return 2 + case .badJumpDestination: return 3 + case .outOfMemory: return 4 + case .precompiledContract: return 5 + case .stackTooSmall: return 6 + case .stackTooLarge: return 7 + case .illegalOperation: return 8 + case .stackOverflow: return 9 + case .outOfEnergy: return 10 + case .outOfTime: return 11 + case .jvmStackOverFlow: return 12 + case .unknown: return 13 + case .transferFailed: return 14 + case .invalidCode: return 15 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Transaction.Result.contractResult] = [ + .default, + .success, + .revert, + .badJumpDestination, + .outOfMemory, + .precompiledContract, + .stackTooSmall, + .stackTooLarge, + .illegalOperation, + .stackOverflow, + .outOfEnergy, + .outOfTime, + .jvmStackOverFlow, + .unknown, + .transferFailed, + .invalidCode, + ] + + } + + init() {} + } + + struct raw: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var refBlockBytes: Data = Data() + + var refBlockNum: Int64 = 0 + + var refBlockHash: Data = Data() + + var expiration: Int64 = 0 + + var auths: [Protocol_authority] = [] + + /// data not used + var data: Data = Data() + + ///only support size = 1, repeated list here for extension + var contract: [Protocol_Transaction.Contract] = [] + + /// scripts not used + var scripts: Data = Data() + + var timestamp: Int64 = 0 + + var feeLimit: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _rawData: Protocol_Transaction.raw? = nil +} + +struct Protocol_TransactionInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var id: Data { + get {return _storage._id} + set {_uniqueStorage()._id = newValue} + } + + var fee: Int64 { + get {return _storage._fee} + set {_uniqueStorage()._fee = newValue} + } + + var blockNumber: Int64 { + get {return _storage._blockNumber} + set {_uniqueStorage()._blockNumber = newValue} + } + + var blockTimeStamp: Int64 { + get {return _storage._blockTimeStamp} + set {_uniqueStorage()._blockTimeStamp = newValue} + } + + var contractResult: [Data] { + get {return _storage._contractResult} + set {_uniqueStorage()._contractResult = newValue} + } + + var contractAddress: Data { + get {return _storage._contractAddress} + set {_uniqueStorage()._contractAddress = newValue} + } + + var receipt: Protocol_ResourceReceipt { + get {return _storage._receipt ?? Protocol_ResourceReceipt()} + set {_uniqueStorage()._receipt = newValue} + } + /// Returns true if `receipt` has been explicitly set. + var hasReceipt: Bool {return _storage._receipt != nil} + /// Clears the value of `receipt`. Subsequent reads from it will return its default value. + mutating func clearReceipt() {_uniqueStorage()._receipt = nil} + + var log: [Protocol_TransactionInfo.Log] { + get {return _storage._log} + set {_uniqueStorage()._log = newValue} + } + + var result: Protocol_TransactionInfo.code { + get {return _storage._result} + set {_uniqueStorage()._result = newValue} + } + + var resMessage: Data { + get {return _storage._resMessage} + set {_uniqueStorage()._resMessage = newValue} + } + + var assetIssueID: String { + get {return _storage._assetIssueID} + set {_uniqueStorage()._assetIssueID = newValue} + } + + var withdrawAmount: Int64 { + get {return _storage._withdrawAmount} + set {_uniqueStorage()._withdrawAmount = newValue} + } + + var unfreezeAmount: Int64 { + get {return _storage._unfreezeAmount} + set {_uniqueStorage()._unfreezeAmount = newValue} + } + + var internalTransactions: [Protocol_InternalTransaction] { + get {return _storage._internalTransactions} + set {_uniqueStorage()._internalTransactions = newValue} + } + + var exchangeReceivedAmount: Int64 { + get {return _storage._exchangeReceivedAmount} + set {_uniqueStorage()._exchangeReceivedAmount = newValue} + } + + var exchangeInjectAnotherAmount: Int64 { + get {return _storage._exchangeInjectAnotherAmount} + set {_uniqueStorage()._exchangeInjectAnotherAmount = newValue} + } + + var exchangeWithdrawAnotherAmount: Int64 { + get {return _storage._exchangeWithdrawAnotherAmount} + set {_uniqueStorage()._exchangeWithdrawAnotherAmount = newValue} + } + + var exchangeID: Int64 { + get {return _storage._exchangeID} + set {_uniqueStorage()._exchangeID = newValue} + } + + var shieldedTransactionFee: Int64 { + get {return _storage._shieldedTransactionFee} + set {_uniqueStorage()._shieldedTransactionFee = newValue} + } + + var orderID: Data { + get {return _storage._orderID} + set {_uniqueStorage()._orderID = newValue} + } + + var orderDetails: [Protocol_MarketOrderDetail] { + get {return _storage._orderDetails} + set {_uniqueStorage()._orderDetails = newValue} + } + + var packingFee: Int64 { + get {return _storage._packingFee} + set {_uniqueStorage()._packingFee = newValue} + } + + var withdrawExpireAmount: Int64 { + get {return _storage._withdrawExpireAmount} + set {_uniqueStorage()._withdrawExpireAmount = newValue} + } + + var cancelUnfreezeV2Amount: Dictionary { + get {return _storage._cancelUnfreezeV2Amount} + set {_uniqueStorage()._cancelUnfreezeV2Amount = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum code: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case sucess // = 0 + case failed // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .sucess + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .sucess + case 1: self = .failed + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .sucess: return 0 + case .failed: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_TransactionInfo.code] = [ + .sucess, + .failed, + ] + + } + + struct Log: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: Data = Data() + + var topics: [Data] = [] + + var data: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Protocol_TransactionRet: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var blockNumber: Int64 = 0 + + var blockTimeStamp: Int64 = 0 + + var transactioninfo: [Protocol_TransactionInfo] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_Transactions: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var transactions: [Protocol_Transaction] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_BlockHeader: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var rawData: Protocol_BlockHeader.raw { + get {return _rawData ?? Protocol_BlockHeader.raw()} + set {_rawData = newValue} + } + /// Returns true if `rawData` has been explicitly set. + var hasRawData: Bool {return self._rawData != nil} + /// Clears the value of `rawData`. Subsequent reads from it will return its default value. + mutating func clearRawData() {self._rawData = nil} + + var witnessSignature: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct raw: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var timestamp: Int64 = 0 + + var txTrieRoot: Data = Data() + + var parentHash: Data = Data() + + ///bytes nonce = 5; + ///bytes difficulty = 6; + var number: Int64 = 0 + + var witnessID: Int64 = 0 + + var witnessAddress: Data = Data() + + var version: Int32 = 0 + + var accountStateRoot: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _rawData: Protocol_BlockHeader.raw? = nil +} + +/// block +struct Protocol_Block: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var transactions: [Protocol_Transaction] = [] + + var blockHeader: Protocol_BlockHeader { + get {return _blockHeader ?? Protocol_BlockHeader()} + set {_blockHeader = newValue} + } + /// Returns true if `blockHeader` has been explicitly set. + var hasBlockHeader: Bool {return self._blockHeader != nil} + /// Clears the value of `blockHeader`. Subsequent reads from it will return its default value. + mutating func clearBlockHeader() {self._blockHeader = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _blockHeader: Protocol_BlockHeader? = nil +} + +struct Protocol_ChainInventory: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ids: [Protocol_ChainInventory.BlockId] = [] + + var remainNum: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct BlockId: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var hash: Data = Data() + + var number: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} +} + +/// Inventory +struct Protocol_BlockInventory: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ids: [Protocol_BlockInventory.BlockId] = [] + + var type: Protocol_BlockInventory.TypeEnum = .sync + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum TypeEnum: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case sync // = 0 + case advtise // = 1 + case fetch // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .sync + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .sync + case 1: self = .advtise + case 2: self = .fetch + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .sync: return 0 + case .advtise: return 1 + case .fetch: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_BlockInventory.TypeEnum] = [ + .sync, + .advtise, + .fetch, + ] + + } + + struct BlockId: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var hash: Data = Data() + + var number: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} +} + +struct Protocol_Inventory: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Protocol_Inventory.InventoryType = .trx + + var ids: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum InventoryType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case trx // = 0 + case block // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .trx + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .trx + case 1: self = .block + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .trx: return 0 + case .block: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Inventory.InventoryType] = [ + .trx, + .block, + ] + + } + + init() {} +} + +struct Protocol_Items: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Protocol_Items.ItemType = .err + + var blocks: [Protocol_Block] = [] + + var blockHeaders: [Protocol_BlockHeader] = [] + + var transactions: [Protocol_Transaction] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum ItemType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case err // = 0 + case trx // = 1 + case block // = 2 + case blockheader // = 3 + case UNRECOGNIZED(Int) + + init() { + self = .err + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .err + case 1: self = .trx + case 2: self = .block + case 3: self = .blockheader + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .err: return 0 + case .trx: return 1 + case .block: return 2 + case .blockheader: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_Items.ItemType] = [ + .err, + .trx, + .block, + .blockheader, + ] + + } + + init() {} +} + +/// DynamicProperties +struct Protocol_DynamicProperties: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var lastSolidityBlockNum: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_DisconnectMessage: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var reason: Protocol_ReasonCode = .requested + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_HelloMessage: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var from: Protocol_Endpoint { + get {return _from ?? Protocol_Endpoint()} + set {_from = newValue} + } + /// Returns true if `from` has been explicitly set. + var hasFrom: Bool {return self._from != nil} + /// Clears the value of `from`. Subsequent reads from it will return its default value. + mutating func clearFrom() {self._from = nil} + + var version: Int32 = 0 + + var timestamp: Int64 = 0 + + var genesisBlockID: Protocol_HelloMessage.BlockId { + get {return _genesisBlockID ?? Protocol_HelloMessage.BlockId()} + set {_genesisBlockID = newValue} + } + /// Returns true if `genesisBlockID` has been explicitly set. + var hasGenesisBlockID: Bool {return self._genesisBlockID != nil} + /// Clears the value of `genesisBlockID`. Subsequent reads from it will return its default value. + mutating func clearGenesisBlockID() {self._genesisBlockID = nil} + + var solidBlockID: Protocol_HelloMessage.BlockId { + get {return _solidBlockID ?? Protocol_HelloMessage.BlockId()} + set {_solidBlockID = newValue} + } + /// Returns true if `solidBlockID` has been explicitly set. + var hasSolidBlockID: Bool {return self._solidBlockID != nil} + /// Clears the value of `solidBlockID`. Subsequent reads from it will return its default value. + mutating func clearSolidBlockID() {self._solidBlockID = nil} + + var headBlockID: Protocol_HelloMessage.BlockId { + get {return _headBlockID ?? Protocol_HelloMessage.BlockId()} + set {_headBlockID = newValue} + } + /// Returns true if `headBlockID` has been explicitly set. + var hasHeadBlockID: Bool {return self._headBlockID != nil} + /// Clears the value of `headBlockID`. Subsequent reads from it will return its default value. + mutating func clearHeadBlockID() {self._headBlockID = nil} + + var address: Data = Data() + + var signature: Data = Data() + + var nodeType: Int32 = 0 + + var lowestBlockNum: Int64 = 0 + + var codeVersion: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct BlockId: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var hash: Data = Data() + + var number: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _from: Protocol_Endpoint? = nil + fileprivate var _genesisBlockID: Protocol_HelloMessage.BlockId? = nil + fileprivate var _solidBlockID: Protocol_HelloMessage.BlockId? = nil + fileprivate var _headBlockID: Protocol_HelloMessage.BlockId? = nil +} + +struct Protocol_InternalTransaction: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// internalTransaction identity, the root InternalTransaction hash + /// should equals to root transaction id. + var hash: Data = Data() + + /// the one send trx (TBD: or token) via function + var callerAddress: Data = Data() + + /// the one recieve trx (TBD: or token) via function + var transferToAddress: Data = Data() + + var callValueInfo: [Protocol_InternalTransaction.CallValueInfo] = [] + + var note: Data = Data() + + var rejected: Bool = false + + var extra: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct CallValueInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// trx (TBD: or token) value + var callValue: Int64 = 0 + + /// TBD: tokenName, trx should be empty + var tokenID: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} +} + +struct Protocol_DelegatedResourceAccountIndex: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var account: Data = Data() + + var fromAccounts: [Data] = [] + + var toAccounts: [Data] = [] + + var timestamp: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_NodeInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var beginSyncNum: Int64 { + get {return _storage._beginSyncNum} + set {_uniqueStorage()._beginSyncNum = newValue} + } + + var block: String { + get {return _storage._block} + set {_uniqueStorage()._block = newValue} + } + + var solidityBlock: String { + get {return _storage._solidityBlock} + set {_uniqueStorage()._solidityBlock = newValue} + } + + ///connect information + var currentConnectCount: Int32 { + get {return _storage._currentConnectCount} + set {_uniqueStorage()._currentConnectCount = newValue} + } + + var activeConnectCount: Int32 { + get {return _storage._activeConnectCount} + set {_uniqueStorage()._activeConnectCount = newValue} + } + + var passiveConnectCount: Int32 { + get {return _storage._passiveConnectCount} + set {_uniqueStorage()._passiveConnectCount = newValue} + } + + var totalFlow: Int64 { + get {return _storage._totalFlow} + set {_uniqueStorage()._totalFlow = newValue} + } + + var peerInfoList: [Protocol_NodeInfo.PeerInfo] { + get {return _storage._peerInfoList} + set {_uniqueStorage()._peerInfoList = newValue} + } + + var configNodeInfo: Protocol_NodeInfo.ConfigNodeInfo { + get {return _storage._configNodeInfo ?? Protocol_NodeInfo.ConfigNodeInfo()} + set {_uniqueStorage()._configNodeInfo = newValue} + } + /// Returns true if `configNodeInfo` has been explicitly set. + var hasConfigNodeInfo: Bool {return _storage._configNodeInfo != nil} + /// Clears the value of `configNodeInfo`. Subsequent reads from it will return its default value. + mutating func clearConfigNodeInfo() {_uniqueStorage()._configNodeInfo = nil} + + var machineInfo: Protocol_NodeInfo.MachineInfo { + get {return _storage._machineInfo ?? Protocol_NodeInfo.MachineInfo()} + set {_uniqueStorage()._machineInfo = newValue} + } + /// Returns true if `machineInfo` has been explicitly set. + var hasMachineInfo: Bool {return _storage._machineInfo != nil} + /// Clears the value of `machineInfo`. Subsequent reads from it will return its default value. + mutating func clearMachineInfo() {_uniqueStorage()._machineInfo = nil} + + var cheatWitnessInfoMap: Dictionary { + get {return _storage._cheatWitnessInfoMap} + set {_uniqueStorage()._cheatWitnessInfoMap = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct PeerInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var lastSyncBlock: String { + get {return _storage._lastSyncBlock} + set {_uniqueStorage()._lastSyncBlock = newValue} + } + + var remainNum: Int64 { + get {return _storage._remainNum} + set {_uniqueStorage()._remainNum = newValue} + } + + var lastBlockUpdateTime: Int64 { + get {return _storage._lastBlockUpdateTime} + set {_uniqueStorage()._lastBlockUpdateTime = newValue} + } + + var syncFlag: Bool { + get {return _storage._syncFlag} + set {_uniqueStorage()._syncFlag = newValue} + } + + var headBlockTimeWeBothHave: Int64 { + get {return _storage._headBlockTimeWeBothHave} + set {_uniqueStorage()._headBlockTimeWeBothHave = newValue} + } + + var needSyncFromPeer: Bool { + get {return _storage._needSyncFromPeer} + set {_uniqueStorage()._needSyncFromPeer = newValue} + } + + var needSyncFromUs: Bool { + get {return _storage._needSyncFromUs} + set {_uniqueStorage()._needSyncFromUs = newValue} + } + + var host: String { + get {return _storage._host} + set {_uniqueStorage()._host = newValue} + } + + var port: Int32 { + get {return _storage._port} + set {_uniqueStorage()._port = newValue} + } + + var nodeID: String { + get {return _storage._nodeID} + set {_uniqueStorage()._nodeID = newValue} + } + + var connectTime: Int64 { + get {return _storage._connectTime} + set {_uniqueStorage()._connectTime = newValue} + } + + var avgLatency: Double { + get {return _storage._avgLatency} + set {_uniqueStorage()._avgLatency = newValue} + } + + var syncToFetchSize: Int32 { + get {return _storage._syncToFetchSize} + set {_uniqueStorage()._syncToFetchSize = newValue} + } + + var syncToFetchSizePeekNum: Int64 { + get {return _storage._syncToFetchSizePeekNum} + set {_uniqueStorage()._syncToFetchSizePeekNum = newValue} + } + + var syncBlockRequestedSize: Int32 { + get {return _storage._syncBlockRequestedSize} + set {_uniqueStorage()._syncBlockRequestedSize = newValue} + } + + var unFetchSynNum: Int64 { + get {return _storage._unFetchSynNum} + set {_uniqueStorage()._unFetchSynNum = newValue} + } + + var blockInPorcSize: Int32 { + get {return _storage._blockInPorcSize} + set {_uniqueStorage()._blockInPorcSize = newValue} + } + + var headBlockWeBothHave: String { + get {return _storage._headBlockWeBothHave} + set {_uniqueStorage()._headBlockWeBothHave = newValue} + } + + var isActive: Bool { + get {return _storage._isActive} + set {_uniqueStorage()._isActive = newValue} + } + + var score: Int32 { + get {return _storage._score} + set {_uniqueStorage()._score = newValue} + } + + var nodeCount: Int32 { + get {return _storage._nodeCount} + set {_uniqueStorage()._nodeCount = newValue} + } + + var inFlow: Int64 { + get {return _storage._inFlow} + set {_uniqueStorage()._inFlow = newValue} + } + + var disconnectTimes: Int32 { + get {return _storage._disconnectTimes} + set {_uniqueStorage()._disconnectTimes = newValue} + } + + var localDisconnectReason: String { + get {return _storage._localDisconnectReason} + set {_uniqueStorage()._localDisconnectReason = newValue} + } + + var remoteDisconnectReason: String { + get {return _storage._remoteDisconnectReason} + set {_uniqueStorage()._remoteDisconnectReason = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + struct ConfigNodeInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var codeVersion: String { + get {return _storage._codeVersion} + set {_uniqueStorage()._codeVersion = newValue} + } + + var p2PVersion: String { + get {return _storage._p2PVersion} + set {_uniqueStorage()._p2PVersion = newValue} + } + + var listenPort: Int32 { + get {return _storage._listenPort} + set {_uniqueStorage()._listenPort = newValue} + } + + var discoverEnable: Bool { + get {return _storage._discoverEnable} + set {_uniqueStorage()._discoverEnable = newValue} + } + + var activeNodeSize: Int32 { + get {return _storage._activeNodeSize} + set {_uniqueStorage()._activeNodeSize = newValue} + } + + var passiveNodeSize: Int32 { + get {return _storage._passiveNodeSize} + set {_uniqueStorage()._passiveNodeSize = newValue} + } + + var sendNodeSize: Int32 { + get {return _storage._sendNodeSize} + set {_uniqueStorage()._sendNodeSize = newValue} + } + + var maxConnectCount: Int32 { + get {return _storage._maxConnectCount} + set {_uniqueStorage()._maxConnectCount = newValue} + } + + var sameIpMaxConnectCount: Int32 { + get {return _storage._sameIpMaxConnectCount} + set {_uniqueStorage()._sameIpMaxConnectCount = newValue} + } + + var backupListenPort: Int32 { + get {return _storage._backupListenPort} + set {_uniqueStorage()._backupListenPort = newValue} + } + + var backupMemberSize: Int32 { + get {return _storage._backupMemberSize} + set {_uniqueStorage()._backupMemberSize = newValue} + } + + var backupPriority: Int32 { + get {return _storage._backupPriority} + set {_uniqueStorage()._backupPriority = newValue} + } + + var dbVersion: Int32 { + get {return _storage._dbVersion} + set {_uniqueStorage()._dbVersion = newValue} + } + + var minParticipationRate: Int32 { + get {return _storage._minParticipationRate} + set {_uniqueStorage()._minParticipationRate = newValue} + } + + var supportConstant: Bool { + get {return _storage._supportConstant} + set {_uniqueStorage()._supportConstant = newValue} + } + + var minTimeRatio: Double { + get {return _storage._minTimeRatio} + set {_uniqueStorage()._minTimeRatio = newValue} + } + + var maxTimeRatio: Double { + get {return _storage._maxTimeRatio} + set {_uniqueStorage()._maxTimeRatio = newValue} + } + + var allowCreationOfContracts: Int64 { + get {return _storage._allowCreationOfContracts} + set {_uniqueStorage()._allowCreationOfContracts = newValue} + } + + var allowAdaptiveEnergy: Int64 { + get {return _storage._allowAdaptiveEnergy} + set {_uniqueStorage()._allowAdaptiveEnergy = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + struct MachineInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var threadCount: Int32 = 0 + + var deadLockThreadCount: Int32 = 0 + + var cpuCount: Int32 = 0 + + var totalMemory: Int64 = 0 + + var freeMemory: Int64 = 0 + + var cpuRate: Double = 0 + + var javaVersion: String = String() + + var osName: String = String() + + var jvmTotalMemory: Int64 = 0 + + var jvmFreeMemory: Int64 = 0 + + var processCpuRate: Double = 0 + + var memoryDescInfoList: [Protocol_NodeInfo.MachineInfo.MemoryDescInfo] = [] + + var deadLockThreadInfoList: [Protocol_NodeInfo.MachineInfo.DeadLockThreadInfo] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct MemoryDescInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String = String() + + var initSize: Int64 = 0 + + var useSize: Int64 = 0 + + var maxSize: Int64 = 0 + + var useRate: Double = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct DeadLockThreadInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String = String() + + var lockName: String = String() + + var lockOwner: String = String() + + var state: String = String() + + var blockTime: Int64 = 0 + + var waitTime: Int64 = 0 + + var stackTrace: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Protocol_MetricsInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var interval: Int64 = 0 + + var node: Protocol_MetricsInfo.NodeInfo { + get {return _node ?? Protocol_MetricsInfo.NodeInfo()} + set {_node = newValue} + } + /// Returns true if `node` has been explicitly set. + var hasNode: Bool {return self._node != nil} + /// Clears the value of `node`. Subsequent reads from it will return its default value. + mutating func clearNode() {self._node = nil} + + var blockchain: Protocol_MetricsInfo.BlockChainInfo { + get {return _blockchain ?? Protocol_MetricsInfo.BlockChainInfo()} + set {_blockchain = newValue} + } + /// Returns true if `blockchain` has been explicitly set. + var hasBlockchain: Bool {return self._blockchain != nil} + /// Clears the value of `blockchain`. Subsequent reads from it will return its default value. + mutating func clearBlockchain() {self._blockchain = nil} + + var net: Protocol_MetricsInfo.NetInfo { + get {return _net ?? Protocol_MetricsInfo.NetInfo()} + set {_net = newValue} + } + /// Returns true if `net` has been explicitly set. + var hasNet: Bool {return self._net != nil} + /// Clears the value of `net`. Subsequent reads from it will return its default value. + mutating func clearNet() {self._net = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NodeInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ip: String = String() + + var nodeType: Int32 = 0 + + var version: String = String() + + var backupStatus: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct BlockChainInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var headBlockNum: Int64 { + get {return _storage._headBlockNum} + set {_uniqueStorage()._headBlockNum = newValue} + } + + var headBlockTimestamp: Int64 { + get {return _storage._headBlockTimestamp} + set {_uniqueStorage()._headBlockTimestamp = newValue} + } + + var headBlockHash: String { + get {return _storage._headBlockHash} + set {_uniqueStorage()._headBlockHash = newValue} + } + + var forkCount: Int32 { + get {return _storage._forkCount} + set {_uniqueStorage()._forkCount = newValue} + } + + var failForkCount: Int32 { + get {return _storage._failForkCount} + set {_uniqueStorage()._failForkCount = newValue} + } + + var blockProcessTime: Protocol_MetricsInfo.RateInfo { + get {return _storage._blockProcessTime ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._blockProcessTime = newValue} + } + /// Returns true if `blockProcessTime` has been explicitly set. + var hasBlockProcessTime: Bool {return _storage._blockProcessTime != nil} + /// Clears the value of `blockProcessTime`. Subsequent reads from it will return its default value. + mutating func clearBlockProcessTime() {_uniqueStorage()._blockProcessTime = nil} + + var tps: Protocol_MetricsInfo.RateInfo { + get {return _storage._tps ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._tps = newValue} + } + /// Returns true if `tps` has been explicitly set. + var hasTps: Bool {return _storage._tps != nil} + /// Clears the value of `tps`. Subsequent reads from it will return its default value. + mutating func clearTps() {_uniqueStorage()._tps = nil} + + var transactionCacheSize: Int32 { + get {return _storage._transactionCacheSize} + set {_uniqueStorage()._transactionCacheSize = newValue} + } + + var missedTransaction: Protocol_MetricsInfo.RateInfo { + get {return _storage._missedTransaction ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._missedTransaction = newValue} + } + /// Returns true if `missedTransaction` has been explicitly set. + var hasMissedTransaction: Bool {return _storage._missedTransaction != nil} + /// Clears the value of `missedTransaction`. Subsequent reads from it will return its default value. + mutating func clearMissedTransaction() {_uniqueStorage()._missedTransaction = nil} + + var witnesses: [Protocol_MetricsInfo.BlockChainInfo.Witness] { + get {return _storage._witnesses} + set {_uniqueStorage()._witnesses = newValue} + } + + var failProcessBlockNum: Int64 { + get {return _storage._failProcessBlockNum} + set {_uniqueStorage()._failProcessBlockNum = newValue} + } + + var failProcessBlockReason: String { + get {return _storage._failProcessBlockReason} + set {_uniqueStorage()._failProcessBlockReason = newValue} + } + + var dupWitness: [Protocol_MetricsInfo.BlockChainInfo.DupWitness] { + get {return _storage._dupWitness} + set {_uniqueStorage()._dupWitness = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Witness: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: String = String() + + var version: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct DupWitness: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: String = String() + + var blockNum: Int64 = 0 + + var count: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + struct RateInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var count: Int64 = 0 + + var meanRate: Double = 0 + + var oneMinuteRate: Double = 0 + + var fiveMinuteRate: Double = 0 + + var fifteenMinuteRate: Double = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct NetInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var errorProtoCount: Int32 { + get {return _storage._errorProtoCount} + set {_uniqueStorage()._errorProtoCount = newValue} + } + + var api: Protocol_MetricsInfo.NetInfo.ApiInfo { + get {return _storage._api ?? Protocol_MetricsInfo.NetInfo.ApiInfo()} + set {_uniqueStorage()._api = newValue} + } + /// Returns true if `api` has been explicitly set. + var hasApi: Bool {return _storage._api != nil} + /// Clears the value of `api`. Subsequent reads from it will return its default value. + mutating func clearApi() {_uniqueStorage()._api = nil} + + var connectionCount: Int32 { + get {return _storage._connectionCount} + set {_uniqueStorage()._connectionCount = newValue} + } + + var validConnectionCount: Int32 { + get {return _storage._validConnectionCount} + set {_uniqueStorage()._validConnectionCount = newValue} + } + + var tcpInTraffic: Protocol_MetricsInfo.RateInfo { + get {return _storage._tcpInTraffic ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._tcpInTraffic = newValue} + } + /// Returns true if `tcpInTraffic` has been explicitly set. + var hasTcpInTraffic: Bool {return _storage._tcpInTraffic != nil} + /// Clears the value of `tcpInTraffic`. Subsequent reads from it will return its default value. + mutating func clearTcpInTraffic() {_uniqueStorage()._tcpInTraffic = nil} + + var tcpOutTraffic: Protocol_MetricsInfo.RateInfo { + get {return _storage._tcpOutTraffic ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._tcpOutTraffic = newValue} + } + /// Returns true if `tcpOutTraffic` has been explicitly set. + var hasTcpOutTraffic: Bool {return _storage._tcpOutTraffic != nil} + /// Clears the value of `tcpOutTraffic`. Subsequent reads from it will return its default value. + mutating func clearTcpOutTraffic() {_uniqueStorage()._tcpOutTraffic = nil} + + var disconnectionCount: Int32 { + get {return _storage._disconnectionCount} + set {_uniqueStorage()._disconnectionCount = newValue} + } + + var disconnectionDetail: [Protocol_MetricsInfo.NetInfo.DisconnectionDetailInfo] { + get {return _storage._disconnectionDetail} + set {_uniqueStorage()._disconnectionDetail = newValue} + } + + var udpInTraffic: Protocol_MetricsInfo.RateInfo { + get {return _storage._udpInTraffic ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._udpInTraffic = newValue} + } + /// Returns true if `udpInTraffic` has been explicitly set. + var hasUdpInTraffic: Bool {return _storage._udpInTraffic != nil} + /// Clears the value of `udpInTraffic`. Subsequent reads from it will return its default value. + mutating func clearUdpInTraffic() {_uniqueStorage()._udpInTraffic = nil} + + var udpOutTraffic: Protocol_MetricsInfo.RateInfo { + get {return _storage._udpOutTraffic ?? Protocol_MetricsInfo.RateInfo()} + set {_uniqueStorage()._udpOutTraffic = newValue} + } + /// Returns true if `udpOutTraffic` has been explicitly set. + var hasUdpOutTraffic: Bool {return _storage._udpOutTraffic != nil} + /// Clears the value of `udpOutTraffic`. Subsequent reads from it will return its default value. + mutating func clearUdpOutTraffic() {_uniqueStorage()._udpOutTraffic = nil} + + var latency: Protocol_MetricsInfo.NetInfo.LatencyInfo { + get {return _storage._latency ?? Protocol_MetricsInfo.NetInfo.LatencyInfo()} + set {_uniqueStorage()._latency = newValue} + } + /// Returns true if `latency` has been explicitly set. + var hasLatency: Bool {return _storage._latency != nil} + /// Clears the value of `latency`. Subsequent reads from it will return its default value. + mutating func clearLatency() {_uniqueStorage()._latency = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct ApiInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var qps: Protocol_MetricsInfo.RateInfo { + get {return _qps ?? Protocol_MetricsInfo.RateInfo()} + set {_qps = newValue} + } + /// Returns true if `qps` has been explicitly set. + var hasQps: Bool {return self._qps != nil} + /// Clears the value of `qps`. Subsequent reads from it will return its default value. + mutating func clearQps() {self._qps = nil} + + var failQps: Protocol_MetricsInfo.RateInfo { + get {return _failQps ?? Protocol_MetricsInfo.RateInfo()} + set {_failQps = newValue} + } + /// Returns true if `failQps` has been explicitly set. + var hasFailQps: Bool {return self._failQps != nil} + /// Clears the value of `failQps`. Subsequent reads from it will return its default value. + mutating func clearFailQps() {self._failQps = nil} + + var outTraffic: Protocol_MetricsInfo.RateInfo { + get {return _outTraffic ?? Protocol_MetricsInfo.RateInfo()} + set {_outTraffic = newValue} + } + /// Returns true if `outTraffic` has been explicitly set. + var hasOutTraffic: Bool {return self._outTraffic != nil} + /// Clears the value of `outTraffic`. Subsequent reads from it will return its default value. + mutating func clearOutTraffic() {self._outTraffic = nil} + + var detail: [Protocol_MetricsInfo.NetInfo.ApiInfo.ApiDetailInfo] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct ApiDetailInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String = String() + + var qps: Protocol_MetricsInfo.RateInfo { + get {return _qps ?? Protocol_MetricsInfo.RateInfo()} + set {_qps = newValue} + } + /// Returns true if `qps` has been explicitly set. + var hasQps: Bool {return self._qps != nil} + /// Clears the value of `qps`. Subsequent reads from it will return its default value. + mutating func clearQps() {self._qps = nil} + + var failQps: Protocol_MetricsInfo.RateInfo { + get {return _failQps ?? Protocol_MetricsInfo.RateInfo()} + set {_failQps = newValue} + } + /// Returns true if `failQps` has been explicitly set. + var hasFailQps: Bool {return self._failQps != nil} + /// Clears the value of `failQps`. Subsequent reads from it will return its default value. + mutating func clearFailQps() {self._failQps = nil} + + var outTraffic: Protocol_MetricsInfo.RateInfo { + get {return _outTraffic ?? Protocol_MetricsInfo.RateInfo()} + set {_outTraffic = newValue} + } + /// Returns true if `outTraffic` has been explicitly set. + var hasOutTraffic: Bool {return self._outTraffic != nil} + /// Clears the value of `outTraffic`. Subsequent reads from it will return its default value. + mutating func clearOutTraffic() {self._outTraffic = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _qps: Protocol_MetricsInfo.RateInfo? = nil + fileprivate var _failQps: Protocol_MetricsInfo.RateInfo? = nil + fileprivate var _outTraffic: Protocol_MetricsInfo.RateInfo? = nil + } + + init() {} + + fileprivate var _qps: Protocol_MetricsInfo.RateInfo? = nil + fileprivate var _failQps: Protocol_MetricsInfo.RateInfo? = nil + fileprivate var _outTraffic: Protocol_MetricsInfo.RateInfo? = nil + } + + struct DisconnectionDetailInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var reason: String = String() + + var count: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + struct LatencyInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var top99: Int32 = 0 + + var top95: Int32 = 0 + + var top75: Int32 = 0 + + var totalCount: Int32 = 0 + + var delay1S: Int32 = 0 + + var delay2S: Int32 = 0 + + var delay3S: Int32 = 0 + + var detail: [Protocol_MetricsInfo.NetInfo.LatencyInfo.LatencyDetailInfo] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct LatencyDetailInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var witness: String = String() + + var top99: Int32 = 0 + + var top95: Int32 = 0 + + var top75: Int32 = 0 + + var count: Int32 = 0 + + var delay1S: Int32 = 0 + + var delay2S: Int32 = 0 + + var delay3S: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + init() {} + + fileprivate var _node: Protocol_MetricsInfo.NodeInfo? = nil + fileprivate var _blockchain: Protocol_MetricsInfo.BlockChainInfo? = nil + fileprivate var _net: Protocol_MetricsInfo.NetInfo? = nil +} + +struct Protocol_PBFTMessage: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var rawData: Protocol_PBFTMessage.Raw { + get {return _rawData ?? Protocol_PBFTMessage.Raw()} + set {_rawData = newValue} + } + /// Returns true if `rawData` has been explicitly set. + var hasRawData: Bool {return self._rawData != nil} + /// Clears the value of `rawData`. Subsequent reads from it will return its default value. + mutating func clearRawData() {self._rawData = nil} + + var signature: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum MsgType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case viewChange // = 0 + case request // = 1 + case preprepare // = 2 + case prepare // = 3 + case commit // = 4 + case UNRECOGNIZED(Int) + + init() { + self = .viewChange + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .viewChange + case 1: self = .request + case 2: self = .preprepare + case 3: self = .prepare + case 4: self = .commit + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .viewChange: return 0 + case .request: return 1 + case .preprepare: return 2 + case .prepare: return 3 + case .commit: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_PBFTMessage.MsgType] = [ + .viewChange, + .request, + .preprepare, + .prepare, + .commit, + ] + + } + + enum DataType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case block // = 0 + case srl // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .block + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .block + case 1: self = .srl + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .block: return 0 + case .srl: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_PBFTMessage.DataType] = [ + .block, + .srl, + ] + + } + + struct Raw: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var msgType: Protocol_PBFTMessage.MsgType = .viewChange + + var dataType: Protocol_PBFTMessage.DataType = .block + + var viewN: Int64 = 0 + + var epoch: Int64 = 0 + + var data: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _rawData: Protocol_PBFTMessage.Raw? = nil +} + +struct Protocol_PBFTCommitResult: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: Data = Data() + + var signature: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_SRL: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var srAddress: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_AccountType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "Normal"), + 1: .same(proto: "AssetIssue"), + 2: .same(proto: "Contract"), + ] +} + +extension Protocol_ReasonCode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "REQUESTED"), + 2: .same(proto: "BAD_PROTOCOL"), + 4: .same(proto: "TOO_MANY_PEERS"), + 5: .same(proto: "DUPLICATE_PEER"), + 6: .same(proto: "INCOMPATIBLE_PROTOCOL"), + 7: .same(proto: "RANDOM_ELIMINATION"), + 8: .same(proto: "PEER_QUITING"), + 9: .same(proto: "UNEXPECTED_IDENTITY"), + 10: .same(proto: "LOCAL_IDENTITY"), + 11: .same(proto: "PING_TIMEOUT"), + 16: .same(proto: "USER_REASON"), + 17: .same(proto: "RESET"), + 18: .same(proto: "SYNC_FAIL"), + 19: .same(proto: "FETCH_FAIL"), + 20: .same(proto: "BAD_TX"), + 21: .same(proto: "BAD_BLOCK"), + 22: .same(proto: "FORKED"), + 23: .same(proto: "UNLINKABLE"), + 24: .same(proto: "INCOMPATIBLE_VERSION"), + 25: .same(proto: "INCOMPATIBLE_CHAIN"), + 32: .same(proto: "TIME_OUT"), + 33: .same(proto: "CONNECT_FAIL"), + 34: .same(proto: "TOO_MANY_PEERS_WITH_SAME_IP"), + 35: .same(proto: "LIGHT_NODE_SYNC_FAIL"), + 36: .same(proto: "BELOW_THAN_ME"), + 37: .same(proto: "NOT_WITNESS"), + 38: .same(proto: "NO_SUCH_MESSAGE"), + 255: .same(proto: "UNKNOWN"), + ] +} + +extension Protocol_AccountId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountId" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.name) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.address) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularBytesField(value: self.name, fieldNumber: 1) + } + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountId, rhs: Protocol_AccountId) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.address != rhs.address {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Vote: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Vote" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "vote_address"), + 2: .standard(proto: "vote_count"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.voteAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.voteCount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.voteAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.voteAddress, fieldNumber: 1) + } + if self.voteCount != 0 { + try visitor.visitSingularInt64Field(value: self.voteCount, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Vote, rhs: Protocol_Vote) -> Bool { + if lhs.voteAddress != rhs.voteAddress {return false} + if lhs.voteCount != rhs.voteCount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Proposal: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Proposal" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "proposal_id"), + 2: .standard(proto: "proposer_address"), + 3: .same(proto: "parameters"), + 4: .standard(proto: "expiration_time"), + 5: .standard(proto: "create_time"), + 6: .same(proto: "approvals"), + 7: .same(proto: "state"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.proposalID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.proposerAddress) }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.parameters) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.expirationTime) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.createTime) }() + case 6: try { try decoder.decodeRepeatedBytesField(value: &self.approvals) }() + case 7: try { try decoder.decodeSingularEnumField(value: &self.state) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.proposalID != 0 { + try visitor.visitSingularInt64Field(value: self.proposalID, fieldNumber: 1) + } + if !self.proposerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.proposerAddress, fieldNumber: 2) + } + if !self.parameters.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.parameters, fieldNumber: 3) + } + if self.expirationTime != 0 { + try visitor.visitSingularInt64Field(value: self.expirationTime, fieldNumber: 4) + } + if self.createTime != 0 { + try visitor.visitSingularInt64Field(value: self.createTime, fieldNumber: 5) + } + if !self.approvals.isEmpty { + try visitor.visitRepeatedBytesField(value: self.approvals, fieldNumber: 6) + } + if self.state != .pending { + try visitor.visitSingularEnumField(value: self.state, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Proposal, rhs: Protocol_Proposal) -> Bool { + if lhs.proposalID != rhs.proposalID {return false} + if lhs.proposerAddress != rhs.proposerAddress {return false} + if lhs.parameters != rhs.parameters {return false} + if lhs.expirationTime != rhs.expirationTime {return false} + if lhs.createTime != rhs.createTime {return false} + if lhs.approvals != rhs.approvals {return false} + if lhs.state != rhs.state {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Proposal.State: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PENDING"), + 1: .same(proto: "DISAPPROVED"), + 2: .same(proto: "APPROVED"), + 3: .same(proto: "CANCELED"), + ] +} + +extension Protocol_Exchange: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Exchange" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "exchange_id"), + 2: .standard(proto: "creator_address"), + 3: .standard(proto: "create_time"), + 6: .standard(proto: "first_token_id"), + 7: .standard(proto: "first_token_balance"), + 8: .standard(proto: "second_token_id"), + 9: .standard(proto: "second_token_balance"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.exchangeID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.creatorAddress) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.createTime) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self.firstTokenID) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.firstTokenBalance) }() + case 8: try { try decoder.decodeSingularBytesField(value: &self.secondTokenID) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &self.secondTokenBalance) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.exchangeID != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeID, fieldNumber: 1) + } + if !self.creatorAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.creatorAddress, fieldNumber: 2) + } + if self.createTime != 0 { + try visitor.visitSingularInt64Field(value: self.createTime, fieldNumber: 3) + } + if !self.firstTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.firstTokenID, fieldNumber: 6) + } + if self.firstTokenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.firstTokenBalance, fieldNumber: 7) + } + if !self.secondTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.secondTokenID, fieldNumber: 8) + } + if self.secondTokenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.secondTokenBalance, fieldNumber: 9) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Exchange, rhs: Protocol_Exchange) -> Bool { + if lhs.exchangeID != rhs.exchangeID {return false} + if lhs.creatorAddress != rhs.creatorAddress {return false} + if lhs.createTime != rhs.createTime {return false} + if lhs.firstTokenID != rhs.firstTokenID {return false} + if lhs.firstTokenBalance != rhs.firstTokenBalance {return false} + if lhs.secondTokenID != rhs.secondTokenID {return false} + if lhs.secondTokenBalance != rhs.secondTokenBalance {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketOrder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketOrder" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "order_id"), + 2: .standard(proto: "owner_address"), + 3: .standard(proto: "create_time"), + 4: .standard(proto: "sell_token_id"), + 5: .standard(proto: "sell_token_quantity"), + 6: .standard(proto: "buy_token_id"), + 7: .standard(proto: "buy_token_quantity"), + 9: .standard(proto: "sell_token_quantity_remain"), + 10: .standard(proto: "sell_token_quantity_return"), + 11: .same(proto: "state"), + 12: .same(proto: "prev"), + 13: .same(proto: "next"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.orderID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.createTime) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.sellTokenID) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.sellTokenQuantity) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self.buyTokenID) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.buyTokenQuantity) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &self.sellTokenQuantityRemain) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &self.sellTokenQuantityReturn) }() + case 11: try { try decoder.decodeSingularEnumField(value: &self.state) }() + case 12: try { try decoder.decodeSingularBytesField(value: &self.prev) }() + case 13: try { try decoder.decodeSingularBytesField(value: &self.next) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.orderID.isEmpty { + try visitor.visitSingularBytesField(value: self.orderID, fieldNumber: 1) + } + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 2) + } + if self.createTime != 0 { + try visitor.visitSingularInt64Field(value: self.createTime, fieldNumber: 3) + } + if !self.sellTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.sellTokenID, fieldNumber: 4) + } + if self.sellTokenQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.sellTokenQuantity, fieldNumber: 5) + } + if !self.buyTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.buyTokenID, fieldNumber: 6) + } + if self.buyTokenQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.buyTokenQuantity, fieldNumber: 7) + } + if self.sellTokenQuantityRemain != 0 { + try visitor.visitSingularInt64Field(value: self.sellTokenQuantityRemain, fieldNumber: 9) + } + if self.sellTokenQuantityReturn != 0 { + try visitor.visitSingularInt64Field(value: self.sellTokenQuantityReturn, fieldNumber: 10) + } + if self.state != .active { + try visitor.visitSingularEnumField(value: self.state, fieldNumber: 11) + } + if !self.prev.isEmpty { + try visitor.visitSingularBytesField(value: self.prev, fieldNumber: 12) + } + if !self.next.isEmpty { + try visitor.visitSingularBytesField(value: self.next, fieldNumber: 13) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketOrder, rhs: Protocol_MarketOrder) -> Bool { + if lhs.orderID != rhs.orderID {return false} + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.createTime != rhs.createTime {return false} + if lhs.sellTokenID != rhs.sellTokenID {return false} + if lhs.sellTokenQuantity != rhs.sellTokenQuantity {return false} + if lhs.buyTokenID != rhs.buyTokenID {return false} + if lhs.buyTokenQuantity != rhs.buyTokenQuantity {return false} + if lhs.sellTokenQuantityRemain != rhs.sellTokenQuantityRemain {return false} + if lhs.sellTokenQuantityReturn != rhs.sellTokenQuantityReturn {return false} + if lhs.state != rhs.state {return false} + if lhs.prev != rhs.prev {return false} + if lhs.next != rhs.next {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketOrder.State: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ACTIVE"), + 1: .same(proto: "INACTIVE"), + 2: .same(proto: "CANCELED"), + ] +} + +extension Protocol_MarketOrderList: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketOrderList" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "orders"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.orders) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.orders.isEmpty { + try visitor.visitRepeatedMessageField(value: self.orders, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketOrderList, rhs: Protocol_MarketOrderList) -> Bool { + if lhs.orders != rhs.orders {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketOrderPairList: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketOrderPairList" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "orderPair"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.orderPair) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.orderPair.isEmpty { + try visitor.visitRepeatedMessageField(value: self.orderPair, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketOrderPairList, rhs: Protocol_MarketOrderPairList) -> Bool { + if lhs.orderPair != rhs.orderPair {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketOrderPair: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketOrderPair" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sell_token_id"), + 2: .standard(proto: "buy_token_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.sellTokenID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.buyTokenID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.sellTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.sellTokenID, fieldNumber: 1) + } + if !self.buyTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.buyTokenID, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketOrderPair, rhs: Protocol_MarketOrderPair) -> Bool { + if lhs.sellTokenID != rhs.sellTokenID {return false} + if lhs.buyTokenID != rhs.buyTokenID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketAccountOrder: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketAccountOrder" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "orders"), + 3: .same(proto: "count"), + 4: .standard(proto: "total_count"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.orders) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.count) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.totalCount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.orders.isEmpty { + try visitor.visitRepeatedBytesField(value: self.orders, fieldNumber: 2) + } + if self.count != 0 { + try visitor.visitSingularInt64Field(value: self.count, fieldNumber: 3) + } + if self.totalCount != 0 { + try visitor.visitSingularInt64Field(value: self.totalCount, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketAccountOrder, rhs: Protocol_MarketAccountOrder) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.orders != rhs.orders {return false} + if lhs.count != rhs.count {return false} + if lhs.totalCount != rhs.totalCount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketPrice: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketPrice" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sell_token_quantity"), + 2: .standard(proto: "buy_token_quantity"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.sellTokenQuantity) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.buyTokenQuantity) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.sellTokenQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.sellTokenQuantity, fieldNumber: 1) + } + if self.buyTokenQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.buyTokenQuantity, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketPrice, rhs: Protocol_MarketPrice) -> Bool { + if lhs.sellTokenQuantity != rhs.sellTokenQuantity {return false} + if lhs.buyTokenQuantity != rhs.buyTokenQuantity {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketPriceList: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketPriceList" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sell_token_id"), + 2: .standard(proto: "buy_token_id"), + 3: .same(proto: "prices"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.sellTokenID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.buyTokenID) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.prices) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.sellTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.sellTokenID, fieldNumber: 1) + } + if !self.buyTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.buyTokenID, fieldNumber: 2) + } + if !self.prices.isEmpty { + try visitor.visitRepeatedMessageField(value: self.prices, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketPriceList, rhs: Protocol_MarketPriceList) -> Bool { + if lhs.sellTokenID != rhs.sellTokenID {return false} + if lhs.buyTokenID != rhs.buyTokenID {return false} + if lhs.prices != rhs.prices {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketOrderIdList: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketOrderIdList" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "head"), + 2: .same(proto: "tail"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.head) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.tail) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.head.isEmpty { + try visitor.visitSingularBytesField(value: self.head, fieldNumber: 1) + } + if !self.tail.isEmpty { + try visitor.visitSingularBytesField(value: self.tail, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketOrderIdList, rhs: Protocol_MarketOrderIdList) -> Bool { + if lhs.head != rhs.head {return false} + if lhs.tail != rhs.tail {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ChainParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ChainParameters" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "chainParameter"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.chainParameter) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.chainParameter.isEmpty { + try visitor.visitRepeatedMessageField(value: self.chainParameter, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ChainParameters, rhs: Protocol_ChainParameters) -> Bool { + if lhs.chainParameter != rhs.chainParameter {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ChainParameters.ChainParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_ChainParameters.protoMessageName + ".ChainParameter" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "key"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.key.isEmpty { + try visitor.visitSingularStringField(value: self.key, fieldNumber: 1) + } + if self.value != 0 { + try visitor.visitSingularInt64Field(value: self.value, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ChainParameters.ChainParameter, rhs: Protocol_ChainParameters.ChainParameter) -> Bool { + if lhs.key != rhs.key {return false} + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Account: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Account" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "account_name"), + 2: .same(proto: "type"), + 3: .same(proto: "address"), + 4: .same(proto: "balance"), + 5: .same(proto: "votes"), + 6: .same(proto: "asset"), + 56: .same(proto: "assetV2"), + 7: .same(proto: "frozen"), + 8: .standard(proto: "net_usage"), + 41: .standard(proto: "acquired_delegated_frozen_balance_for_bandwidth"), + 42: .standard(proto: "delegated_frozen_balance_for_bandwidth"), + 46: .standard(proto: "old_tron_power"), + 47: .standard(proto: "tron_power"), + 60: .standard(proto: "asset_optimized"), + 9: .standard(proto: "create_time"), + 10: .standard(proto: "latest_opration_time"), + 11: .same(proto: "allowance"), + 12: .standard(proto: "latest_withdraw_time"), + 13: .same(proto: "code"), + 14: .standard(proto: "is_witness"), + 15: .standard(proto: "is_committee"), + 16: .standard(proto: "frozen_supply"), + 17: .standard(proto: "asset_issued_name"), + 57: .standard(proto: "asset_issued_ID"), + 18: .standard(proto: "latest_asset_operation_time"), + 58: .standard(proto: "latest_asset_operation_timeV2"), + 19: .standard(proto: "free_net_usage"), + 20: .standard(proto: "free_asset_net_usage"), + 59: .standard(proto: "free_asset_net_usageV2"), + 21: .standard(proto: "latest_consume_time"), + 22: .standard(proto: "latest_consume_free_time"), + 23: .standard(proto: "account_id"), + 24: .standard(proto: "net_window_size"), + 25: .standard(proto: "net_window_optimized"), + 26: .standard(proto: "account_resource"), + 30: .same(proto: "codeHash"), + 31: .standard(proto: "owner_permission"), + 32: .standard(proto: "witness_permission"), + 33: .standard(proto: "active_permission"), + 34: .same(proto: "frozenV2"), + 35: .same(proto: "unfrozenV2"), + 36: .standard(proto: "delegated_frozenV2_balance_for_bandwidth"), + 37: .standard(proto: "acquired_delegated_frozenV2_balance_for_bandwidth"), + ] + + fileprivate class _StorageClass { + var _accountName: Data = Data() + var _type: Protocol_AccountType = .normal + var _address: Data = Data() + var _balance: Int64 = 0 + var _votes: [Protocol_Vote] = [] + var _asset: Dictionary = [:] + var _assetV2: Dictionary = [:] + var _frozen: [Protocol_Account.Frozen] = [] + var _netUsage: Int64 = 0 + var _acquiredDelegatedFrozenBalanceForBandwidth: Int64 = 0 + var _delegatedFrozenBalanceForBandwidth: Int64 = 0 + var _oldTronPower: Int64 = 0 + var _tronPower: Protocol_Account.Frozen? = nil + var _assetOptimized: Bool = false + var _createTime: Int64 = 0 + var _latestOprationTime: Int64 = 0 + var _allowance: Int64 = 0 + var _latestWithdrawTime: Int64 = 0 + var _code: Data = Data() + var _isWitness: Bool = false + var _isCommittee: Bool = false + var _frozenSupply: [Protocol_Account.Frozen] = [] + var _assetIssuedName: Data = Data() + var _assetIssuedID: Data = Data() + var _latestAssetOperationTime: Dictionary = [:] + var _latestAssetOperationTimeV2: Dictionary = [:] + var _freeNetUsage: Int64 = 0 + var _freeAssetNetUsage: Dictionary = [:] + var _freeAssetNetUsageV2: Dictionary = [:] + var _latestConsumeTime: Int64 = 0 + var _latestConsumeFreeTime: Int64 = 0 + var _accountID: Data = Data() + var _netWindowSize: Int64 = 0 + var _netWindowOptimized: Bool = false + var _accountResource: Protocol_Account.AccountResource? = nil + var _codeHash: Data = Data() + var _ownerPermission: Protocol_Permission? = nil + var _witnessPermission: Protocol_Permission? = nil + var _activePermission: [Protocol_Permission] = [] + var _frozenV2: [Protocol_Account.FreezeV2] = [] + var _unfrozenV2: [Protocol_Account.UnFreezeV2] = [] + var _delegatedFrozenV2BalanceForBandwidth: Int64 = 0 + var _acquiredDelegatedFrozenV2BalanceForBandwidth: Int64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _accountName = source._accountName + _type = source._type + _address = source._address + _balance = source._balance + _votes = source._votes + _asset = source._asset + _assetV2 = source._assetV2 + _frozen = source._frozen + _netUsage = source._netUsage + _acquiredDelegatedFrozenBalanceForBandwidth = source._acquiredDelegatedFrozenBalanceForBandwidth + _delegatedFrozenBalanceForBandwidth = source._delegatedFrozenBalanceForBandwidth + _oldTronPower = source._oldTronPower + _tronPower = source._tronPower + _assetOptimized = source._assetOptimized + _createTime = source._createTime + _latestOprationTime = source._latestOprationTime + _allowance = source._allowance + _latestWithdrawTime = source._latestWithdrawTime + _code = source._code + _isWitness = source._isWitness + _isCommittee = source._isCommittee + _frozenSupply = source._frozenSupply + _assetIssuedName = source._assetIssuedName + _assetIssuedID = source._assetIssuedID + _latestAssetOperationTime = source._latestAssetOperationTime + _latestAssetOperationTimeV2 = source._latestAssetOperationTimeV2 + _freeNetUsage = source._freeNetUsage + _freeAssetNetUsage = source._freeAssetNetUsage + _freeAssetNetUsageV2 = source._freeAssetNetUsageV2 + _latestConsumeTime = source._latestConsumeTime + _latestConsumeFreeTime = source._latestConsumeFreeTime + _accountID = source._accountID + _netWindowSize = source._netWindowSize + _netWindowOptimized = source._netWindowOptimized + _accountResource = source._accountResource + _codeHash = source._codeHash + _ownerPermission = source._ownerPermission + _witnessPermission = source._witnessPermission + _activePermission = source._activePermission + _frozenV2 = source._frozenV2 + _unfrozenV2 = source._unfrozenV2 + _delegatedFrozenV2BalanceForBandwidth = source._delegatedFrozenV2BalanceForBandwidth + _acquiredDelegatedFrozenV2BalanceForBandwidth = source._acquiredDelegatedFrozenV2BalanceForBandwidth + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &_storage._accountName) }() + case 2: try { try decoder.decodeSingularEnumField(value: &_storage._type) }() + case 3: try { try decoder.decodeSingularBytesField(value: &_storage._address) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._balance) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &_storage._votes) }() + case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._asset) }() + case 7: try { try decoder.decodeRepeatedMessageField(value: &_storage._frozen) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &_storage._netUsage) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._createTime) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._latestOprationTime) }() + case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._allowance) }() + case 12: try { try decoder.decodeSingularInt64Field(value: &_storage._latestWithdrawTime) }() + case 13: try { try decoder.decodeSingularBytesField(value: &_storage._code) }() + case 14: try { try decoder.decodeSingularBoolField(value: &_storage._isWitness) }() + case 15: try { try decoder.decodeSingularBoolField(value: &_storage._isCommittee) }() + case 16: try { try decoder.decodeRepeatedMessageField(value: &_storage._frozenSupply) }() + case 17: try { try decoder.decodeSingularBytesField(value: &_storage._assetIssuedName) }() + case 18: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._latestAssetOperationTime) }() + case 19: try { try decoder.decodeSingularInt64Field(value: &_storage._freeNetUsage) }() + case 20: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._freeAssetNetUsage) }() + case 21: try { try decoder.decodeSingularInt64Field(value: &_storage._latestConsumeTime) }() + case 22: try { try decoder.decodeSingularInt64Field(value: &_storage._latestConsumeFreeTime) }() + case 23: try { try decoder.decodeSingularBytesField(value: &_storage._accountID) }() + case 24: try { try decoder.decodeSingularInt64Field(value: &_storage._netWindowSize) }() + case 25: try { try decoder.decodeSingularBoolField(value: &_storage._netWindowOptimized) }() + case 26: try { try decoder.decodeSingularMessageField(value: &_storage._accountResource) }() + case 30: try { try decoder.decodeSingularBytesField(value: &_storage._codeHash) }() + case 31: try { try decoder.decodeSingularMessageField(value: &_storage._ownerPermission) }() + case 32: try { try decoder.decodeSingularMessageField(value: &_storage._witnessPermission) }() + case 33: try { try decoder.decodeRepeatedMessageField(value: &_storage._activePermission) }() + case 34: try { try decoder.decodeRepeatedMessageField(value: &_storage._frozenV2) }() + case 35: try { try decoder.decodeRepeatedMessageField(value: &_storage._unfrozenV2) }() + case 36: try { try decoder.decodeSingularInt64Field(value: &_storage._delegatedFrozenV2BalanceForBandwidth) }() + case 37: try { try decoder.decodeSingularInt64Field(value: &_storage._acquiredDelegatedFrozenV2BalanceForBandwidth) }() + case 41: try { try decoder.decodeSingularInt64Field(value: &_storage._acquiredDelegatedFrozenBalanceForBandwidth) }() + case 42: try { try decoder.decodeSingularInt64Field(value: &_storage._delegatedFrozenBalanceForBandwidth) }() + case 46: try { try decoder.decodeSingularInt64Field(value: &_storage._oldTronPower) }() + case 47: try { try decoder.decodeSingularMessageField(value: &_storage._tronPower) }() + case 56: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._assetV2) }() + case 57: try { try decoder.decodeSingularBytesField(value: &_storage._assetIssuedID) }() + case 58: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._latestAssetOperationTimeV2) }() + case 59: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._freeAssetNetUsageV2) }() + case 60: try { try decoder.decodeSingularBoolField(value: &_storage._assetOptimized) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !_storage._accountName.isEmpty { + try visitor.visitSingularBytesField(value: _storage._accountName, fieldNumber: 1) + } + if _storage._type != .normal { + try visitor.visitSingularEnumField(value: _storage._type, fieldNumber: 2) + } + if !_storage._address.isEmpty { + try visitor.visitSingularBytesField(value: _storage._address, fieldNumber: 3) + } + if _storage._balance != 0 { + try visitor.visitSingularInt64Field(value: _storage._balance, fieldNumber: 4) + } + if !_storage._votes.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._votes, fieldNumber: 5) + } + if !_storage._asset.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._asset, fieldNumber: 6) + } + if !_storage._frozen.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._frozen, fieldNumber: 7) + } + if _storage._netUsage != 0 { + try visitor.visitSingularInt64Field(value: _storage._netUsage, fieldNumber: 8) + } + if _storage._createTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._createTime, fieldNumber: 9) + } + if _storage._latestOprationTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._latestOprationTime, fieldNumber: 10) + } + if _storage._allowance != 0 { + try visitor.visitSingularInt64Field(value: _storage._allowance, fieldNumber: 11) + } + if _storage._latestWithdrawTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._latestWithdrawTime, fieldNumber: 12) + } + if !_storage._code.isEmpty { + try visitor.visitSingularBytesField(value: _storage._code, fieldNumber: 13) + } + if _storage._isWitness != false { + try visitor.visitSingularBoolField(value: _storage._isWitness, fieldNumber: 14) + } + if _storage._isCommittee != false { + try visitor.visitSingularBoolField(value: _storage._isCommittee, fieldNumber: 15) + } + if !_storage._frozenSupply.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._frozenSupply, fieldNumber: 16) + } + if !_storage._assetIssuedName.isEmpty { + try visitor.visitSingularBytesField(value: _storage._assetIssuedName, fieldNumber: 17) + } + if !_storage._latestAssetOperationTime.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._latestAssetOperationTime, fieldNumber: 18) + } + if _storage._freeNetUsage != 0 { + try visitor.visitSingularInt64Field(value: _storage._freeNetUsage, fieldNumber: 19) + } + if !_storage._freeAssetNetUsage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._freeAssetNetUsage, fieldNumber: 20) + } + if _storage._latestConsumeTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._latestConsumeTime, fieldNumber: 21) + } + if _storage._latestConsumeFreeTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._latestConsumeFreeTime, fieldNumber: 22) + } + if !_storage._accountID.isEmpty { + try visitor.visitSingularBytesField(value: _storage._accountID, fieldNumber: 23) + } + if _storage._netWindowSize != 0 { + try visitor.visitSingularInt64Field(value: _storage._netWindowSize, fieldNumber: 24) + } + if _storage._netWindowOptimized != false { + try visitor.visitSingularBoolField(value: _storage._netWindowOptimized, fieldNumber: 25) + } + try { if let v = _storage._accountResource { + try visitor.visitSingularMessageField(value: v, fieldNumber: 26) + } }() + if !_storage._codeHash.isEmpty { + try visitor.visitSingularBytesField(value: _storage._codeHash, fieldNumber: 30) + } + try { if let v = _storage._ownerPermission { + try visitor.visitSingularMessageField(value: v, fieldNumber: 31) + } }() + try { if let v = _storage._witnessPermission { + try visitor.visitSingularMessageField(value: v, fieldNumber: 32) + } }() + if !_storage._activePermission.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._activePermission, fieldNumber: 33) + } + if !_storage._frozenV2.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._frozenV2, fieldNumber: 34) + } + if !_storage._unfrozenV2.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._unfrozenV2, fieldNumber: 35) + } + if _storage._delegatedFrozenV2BalanceForBandwidth != 0 { + try visitor.visitSingularInt64Field(value: _storage._delegatedFrozenV2BalanceForBandwidth, fieldNumber: 36) + } + if _storage._acquiredDelegatedFrozenV2BalanceForBandwidth != 0 { + try visitor.visitSingularInt64Field(value: _storage._acquiredDelegatedFrozenV2BalanceForBandwidth, fieldNumber: 37) + } + if _storage._acquiredDelegatedFrozenBalanceForBandwidth != 0 { + try visitor.visitSingularInt64Field(value: _storage._acquiredDelegatedFrozenBalanceForBandwidth, fieldNumber: 41) + } + if _storage._delegatedFrozenBalanceForBandwidth != 0 { + try visitor.visitSingularInt64Field(value: _storage._delegatedFrozenBalanceForBandwidth, fieldNumber: 42) + } + if _storage._oldTronPower != 0 { + try visitor.visitSingularInt64Field(value: _storage._oldTronPower, fieldNumber: 46) + } + try { if let v = _storage._tronPower { + try visitor.visitSingularMessageField(value: v, fieldNumber: 47) + } }() + if !_storage._assetV2.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._assetV2, fieldNumber: 56) + } + if !_storage._assetIssuedID.isEmpty { + try visitor.visitSingularBytesField(value: _storage._assetIssuedID, fieldNumber: 57) + } + if !_storage._latestAssetOperationTimeV2.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._latestAssetOperationTimeV2, fieldNumber: 58) + } + if !_storage._freeAssetNetUsageV2.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._freeAssetNetUsageV2, fieldNumber: 59) + } + if _storage._assetOptimized != false { + try visitor.visitSingularBoolField(value: _storage._assetOptimized, fieldNumber: 60) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Account, rhs: Protocol_Account) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._accountName != rhs_storage._accountName {return false} + if _storage._type != rhs_storage._type {return false} + if _storage._address != rhs_storage._address {return false} + if _storage._balance != rhs_storage._balance {return false} + if _storage._votes != rhs_storage._votes {return false} + if _storage._asset != rhs_storage._asset {return false} + if _storage._assetV2 != rhs_storage._assetV2 {return false} + if _storage._frozen != rhs_storage._frozen {return false} + if _storage._netUsage != rhs_storage._netUsage {return false} + if _storage._acquiredDelegatedFrozenBalanceForBandwidth != rhs_storage._acquiredDelegatedFrozenBalanceForBandwidth {return false} + if _storage._delegatedFrozenBalanceForBandwidth != rhs_storage._delegatedFrozenBalanceForBandwidth {return false} + if _storage._oldTronPower != rhs_storage._oldTronPower {return false} + if _storage._tronPower != rhs_storage._tronPower {return false} + if _storage._assetOptimized != rhs_storage._assetOptimized {return false} + if _storage._createTime != rhs_storage._createTime {return false} + if _storage._latestOprationTime != rhs_storage._latestOprationTime {return false} + if _storage._allowance != rhs_storage._allowance {return false} + if _storage._latestWithdrawTime != rhs_storage._latestWithdrawTime {return false} + if _storage._code != rhs_storage._code {return false} + if _storage._isWitness != rhs_storage._isWitness {return false} + if _storage._isCommittee != rhs_storage._isCommittee {return false} + if _storage._frozenSupply != rhs_storage._frozenSupply {return false} + if _storage._assetIssuedName != rhs_storage._assetIssuedName {return false} + if _storage._assetIssuedID != rhs_storage._assetIssuedID {return false} + if _storage._latestAssetOperationTime != rhs_storage._latestAssetOperationTime {return false} + if _storage._latestAssetOperationTimeV2 != rhs_storage._latestAssetOperationTimeV2 {return false} + if _storage._freeNetUsage != rhs_storage._freeNetUsage {return false} + if _storage._freeAssetNetUsage != rhs_storage._freeAssetNetUsage {return false} + if _storage._freeAssetNetUsageV2 != rhs_storage._freeAssetNetUsageV2 {return false} + if _storage._latestConsumeTime != rhs_storage._latestConsumeTime {return false} + if _storage._latestConsumeFreeTime != rhs_storage._latestConsumeFreeTime {return false} + if _storage._accountID != rhs_storage._accountID {return false} + if _storage._netWindowSize != rhs_storage._netWindowSize {return false} + if _storage._netWindowOptimized != rhs_storage._netWindowOptimized {return false} + if _storage._accountResource != rhs_storage._accountResource {return false} + if _storage._codeHash != rhs_storage._codeHash {return false} + if _storage._ownerPermission != rhs_storage._ownerPermission {return false} + if _storage._witnessPermission != rhs_storage._witnessPermission {return false} + if _storage._activePermission != rhs_storage._activePermission {return false} + if _storage._frozenV2 != rhs_storage._frozenV2 {return false} + if _storage._unfrozenV2 != rhs_storage._unfrozenV2 {return false} + if _storage._delegatedFrozenV2BalanceForBandwidth != rhs_storage._delegatedFrozenV2BalanceForBandwidth {return false} + if _storage._acquiredDelegatedFrozenV2BalanceForBandwidth != rhs_storage._acquiredDelegatedFrozenV2BalanceForBandwidth {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Account.Frozen: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Account.protoMessageName + ".Frozen" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "frozen_balance"), + 2: .standard(proto: "expire_time"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.frozenBalance) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.expireTime) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.frozenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.frozenBalance, fieldNumber: 1) + } + if self.expireTime != 0 { + try visitor.visitSingularInt64Field(value: self.expireTime, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Account.Frozen, rhs: Protocol_Account.Frozen) -> Bool { + if lhs.frozenBalance != rhs.frozenBalance {return false} + if lhs.expireTime != rhs.expireTime {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Account.AccountResource: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Account.protoMessageName + ".AccountResource" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "energy_usage"), + 2: .standard(proto: "frozen_balance_for_energy"), + 3: .standard(proto: "latest_consume_time_for_energy"), + 4: .standard(proto: "acquired_delegated_frozen_balance_for_energy"), + 5: .standard(proto: "delegated_frozen_balance_for_energy"), + 6: .standard(proto: "storage_limit"), + 7: .standard(proto: "storage_usage"), + 8: .standard(proto: "latest_exchange_storage_time"), + 9: .standard(proto: "energy_window_size"), + 10: .standard(proto: "delegated_frozenV2_balance_for_energy"), + 11: .standard(proto: "acquired_delegated_frozenV2_balance_for_energy"), + 12: .standard(proto: "energy_window_optimized"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.energyUsage) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._frozenBalanceForEnergy) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.latestConsumeTimeForEnergy) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.acquiredDelegatedFrozenBalanceForEnergy) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.delegatedFrozenBalanceForEnergy) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.storageLimit) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.storageUsage) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.latestExchangeStorageTime) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &self.energyWindowSize) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &self.delegatedFrozenV2BalanceForEnergy) }() + case 11: try { try decoder.decodeSingularInt64Field(value: &self.acquiredDelegatedFrozenV2BalanceForEnergy) }() + case 12: try { try decoder.decodeSingularBoolField(value: &self.energyWindowOptimized) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.energyUsage != 0 { + try visitor.visitSingularInt64Field(value: self.energyUsage, fieldNumber: 1) + } + try { if let v = self._frozenBalanceForEnergy { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if self.latestConsumeTimeForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.latestConsumeTimeForEnergy, fieldNumber: 3) + } + if self.acquiredDelegatedFrozenBalanceForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.acquiredDelegatedFrozenBalanceForEnergy, fieldNumber: 4) + } + if self.delegatedFrozenBalanceForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.delegatedFrozenBalanceForEnergy, fieldNumber: 5) + } + if self.storageLimit != 0 { + try visitor.visitSingularInt64Field(value: self.storageLimit, fieldNumber: 6) + } + if self.storageUsage != 0 { + try visitor.visitSingularInt64Field(value: self.storageUsage, fieldNumber: 7) + } + if self.latestExchangeStorageTime != 0 { + try visitor.visitSingularInt64Field(value: self.latestExchangeStorageTime, fieldNumber: 8) + } + if self.energyWindowSize != 0 { + try visitor.visitSingularInt64Field(value: self.energyWindowSize, fieldNumber: 9) + } + if self.delegatedFrozenV2BalanceForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.delegatedFrozenV2BalanceForEnergy, fieldNumber: 10) + } + if self.acquiredDelegatedFrozenV2BalanceForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.acquiredDelegatedFrozenV2BalanceForEnergy, fieldNumber: 11) + } + if self.energyWindowOptimized != false { + try visitor.visitSingularBoolField(value: self.energyWindowOptimized, fieldNumber: 12) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Account.AccountResource, rhs: Protocol_Account.AccountResource) -> Bool { + if lhs.energyUsage != rhs.energyUsage {return false} + if lhs._frozenBalanceForEnergy != rhs._frozenBalanceForEnergy {return false} + if lhs.latestConsumeTimeForEnergy != rhs.latestConsumeTimeForEnergy {return false} + if lhs.acquiredDelegatedFrozenBalanceForEnergy != rhs.acquiredDelegatedFrozenBalanceForEnergy {return false} + if lhs.delegatedFrozenBalanceForEnergy != rhs.delegatedFrozenBalanceForEnergy {return false} + if lhs.storageLimit != rhs.storageLimit {return false} + if lhs.storageUsage != rhs.storageUsage {return false} + if lhs.latestExchangeStorageTime != rhs.latestExchangeStorageTime {return false} + if lhs.energyWindowSize != rhs.energyWindowSize {return false} + if lhs.delegatedFrozenV2BalanceForEnergy != rhs.delegatedFrozenV2BalanceForEnergy {return false} + if lhs.acquiredDelegatedFrozenV2BalanceForEnergy != rhs.acquiredDelegatedFrozenV2BalanceForEnergy {return false} + if lhs.energyWindowOptimized != rhs.energyWindowOptimized {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Account.FreezeV2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Account.protoMessageName + ".FreezeV2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.amount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != .bandwidth { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + if self.amount != 0 { + try visitor.visitSingularInt64Field(value: self.amount, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Account.FreezeV2, rhs: Protocol_Account.FreezeV2) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.amount != rhs.amount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Account.UnFreezeV2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Account.protoMessageName + ".UnFreezeV2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 3: .standard(proto: "unfreeze_amount"), + 4: .standard(proto: "unfreeze_expire_time"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.unfreezeAmount) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.unfreezeExpireTime) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != .bandwidth { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + if self.unfreezeAmount != 0 { + try visitor.visitSingularInt64Field(value: self.unfreezeAmount, fieldNumber: 3) + } + if self.unfreezeExpireTime != 0 { + try visitor.visitSingularInt64Field(value: self.unfreezeExpireTime, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Account.UnFreezeV2, rhs: Protocol_Account.UnFreezeV2) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.unfreezeAmount != rhs.unfreezeAmount {return false} + if lhs.unfreezeExpireTime != rhs.unfreezeExpireTime {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Key: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Key" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "address"), + 2: .same(proto: "weight"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.weight) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 1) + } + if self.weight != 0 { + try visitor.visitSingularInt64Field(value: self.weight, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Key, rhs: Protocol_Key) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.weight != rhs.weight {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_DelegatedResource: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DelegatedResource" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "from"), + 2: .same(proto: "to"), + 3: .standard(proto: "frozen_balance_for_bandwidth"), + 4: .standard(proto: "frozen_balance_for_energy"), + 5: .standard(proto: "expire_time_for_bandwidth"), + 6: .standard(proto: "expire_time_for_energy"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.from) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.to) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.frozenBalanceForBandwidth) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.frozenBalanceForEnergy) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.expireTimeForBandwidth) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.expireTimeForEnergy) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.from.isEmpty { + try visitor.visitSingularBytesField(value: self.from, fieldNumber: 1) + } + if !self.to.isEmpty { + try visitor.visitSingularBytesField(value: self.to, fieldNumber: 2) + } + if self.frozenBalanceForBandwidth != 0 { + try visitor.visitSingularInt64Field(value: self.frozenBalanceForBandwidth, fieldNumber: 3) + } + if self.frozenBalanceForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.frozenBalanceForEnergy, fieldNumber: 4) + } + if self.expireTimeForBandwidth != 0 { + try visitor.visitSingularInt64Field(value: self.expireTimeForBandwidth, fieldNumber: 5) + } + if self.expireTimeForEnergy != 0 { + try visitor.visitSingularInt64Field(value: self.expireTimeForEnergy, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_DelegatedResource, rhs: Protocol_DelegatedResource) -> Bool { + if lhs.from != rhs.from {return false} + if lhs.to != rhs.to {return false} + if lhs.frozenBalanceForBandwidth != rhs.frozenBalanceForBandwidth {return false} + if lhs.frozenBalanceForEnergy != rhs.frozenBalanceForEnergy {return false} + if lhs.expireTimeForBandwidth != rhs.expireTimeForBandwidth {return false} + if lhs.expireTimeForEnergy != rhs.expireTimeForEnergy {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_authority: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".authority" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "account"), + 2: .standard(proto: "permission_name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._account) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.permissionName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._account { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.permissionName.isEmpty { + try visitor.visitSingularBytesField(value: self.permissionName, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_authority, rhs: Protocol_authority) -> Bool { + if lhs._account != rhs._account {return false} + if lhs.permissionName != rhs.permissionName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Permission: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Permission" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "id"), + 3: .standard(proto: "permission_name"), + 4: .same(proto: "threshold"), + 5: .standard(proto: "parent_id"), + 6: .same(proto: "operations"), + 7: .same(proto: "keys"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.id) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.permissionName) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.threshold) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self.parentID) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self.operations) }() + case 7: try { try decoder.decodeRepeatedMessageField(value: &self.keys) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != .owner { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + if self.id != 0 { + try visitor.visitSingularInt32Field(value: self.id, fieldNumber: 2) + } + if !self.permissionName.isEmpty { + try visitor.visitSingularStringField(value: self.permissionName, fieldNumber: 3) + } + if self.threshold != 0 { + try visitor.visitSingularInt64Field(value: self.threshold, fieldNumber: 4) + } + if self.parentID != 0 { + try visitor.visitSingularInt32Field(value: self.parentID, fieldNumber: 5) + } + if !self.operations.isEmpty { + try visitor.visitSingularBytesField(value: self.operations, fieldNumber: 6) + } + if !self.keys.isEmpty { + try visitor.visitRepeatedMessageField(value: self.keys, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Permission, rhs: Protocol_Permission) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.id != rhs.id {return false} + if lhs.permissionName != rhs.permissionName {return false} + if lhs.threshold != rhs.threshold {return false} + if lhs.parentID != rhs.parentID {return false} + if lhs.operations != rhs.operations {return false} + if lhs.keys != rhs.keys {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Permission.PermissionType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "Owner"), + 1: .same(proto: "Witness"), + 2: .same(proto: "Active"), + ] +} + +extension Protocol_Witness: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Witness" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "address"), + 2: .same(proto: "voteCount"), + 3: .same(proto: "pubKey"), + 4: .same(proto: "url"), + 5: .same(proto: "totalProduced"), + 6: .same(proto: "totalMissed"), + 7: .same(proto: "latestBlockNum"), + 8: .same(proto: "latestSlotNum"), + 9: .same(proto: "isJobs"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.voteCount) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.pubKey) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.url) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.totalProduced) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.totalMissed) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.latestBlockNum) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.latestSlotNum) }() + case 9: try { try decoder.decodeSingularBoolField(value: &self.isJobs) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 1) + } + if self.voteCount != 0 { + try visitor.visitSingularInt64Field(value: self.voteCount, fieldNumber: 2) + } + if !self.pubKey.isEmpty { + try visitor.visitSingularBytesField(value: self.pubKey, fieldNumber: 3) + } + if !self.url.isEmpty { + try visitor.visitSingularStringField(value: self.url, fieldNumber: 4) + } + if self.totalProduced != 0 { + try visitor.visitSingularInt64Field(value: self.totalProduced, fieldNumber: 5) + } + if self.totalMissed != 0 { + try visitor.visitSingularInt64Field(value: self.totalMissed, fieldNumber: 6) + } + if self.latestBlockNum != 0 { + try visitor.visitSingularInt64Field(value: self.latestBlockNum, fieldNumber: 7) + } + if self.latestSlotNum != 0 { + try visitor.visitSingularInt64Field(value: self.latestSlotNum, fieldNumber: 8) + } + if self.isJobs != false { + try visitor.visitSingularBoolField(value: self.isJobs, fieldNumber: 9) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Witness, rhs: Protocol_Witness) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.voteCount != rhs.voteCount {return false} + if lhs.pubKey != rhs.pubKey {return false} + if lhs.url != rhs.url {return false} + if lhs.totalProduced != rhs.totalProduced {return false} + if lhs.totalMissed != rhs.totalMissed {return false} + if lhs.latestBlockNum != rhs.latestBlockNum {return false} + if lhs.latestSlotNum != rhs.latestSlotNum {return false} + if lhs.isJobs != rhs.isJobs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Votes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Votes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "address"), + 2: .standard(proto: "old_votes"), + 3: .standard(proto: "new_votes"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.oldVotes) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.newVotes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 1) + } + if !self.oldVotes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.oldVotes, fieldNumber: 2) + } + if !self.newVotes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.newVotes, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Votes, rhs: Protocol_Votes) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.oldVotes != rhs.oldVotes {return false} + if lhs.newVotes != rhs.newVotes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TXOutput: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TXOutput" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "value"), + 2: .same(proto: "pubKeyHash"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.value) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.pubKeyHash) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularInt64Field(value: self.value, fieldNumber: 1) + } + if !self.pubKeyHash.isEmpty { + try visitor.visitSingularBytesField(value: self.pubKeyHash, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TXOutput, rhs: Protocol_TXOutput) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.pubKeyHash != rhs.pubKeyHash {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TXInput: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TXInput" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "raw_data"), + 4: .same(proto: "signature"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._rawData) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.signature) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._rawData { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.signature.isEmpty { + try visitor.visitSingularBytesField(value: self.signature, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TXInput, rhs: Protocol_TXInput) -> Bool { + if lhs._rawData != rhs._rawData {return false} + if lhs.signature != rhs.signature {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TXInput.raw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_TXInput.protoMessageName + ".raw" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "txID"), + 2: .same(proto: "vout"), + 3: .same(proto: "pubKey"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.txID) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.vout) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.pubKey) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.txID.isEmpty { + try visitor.visitSingularBytesField(value: self.txID, fieldNumber: 1) + } + if self.vout != 0 { + try visitor.visitSingularInt64Field(value: self.vout, fieldNumber: 2) + } + if !self.pubKey.isEmpty { + try visitor.visitSingularBytesField(value: self.pubKey, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TXInput.raw, rhs: Protocol_TXInput.raw) -> Bool { + if lhs.txID != rhs.txID {return false} + if lhs.vout != rhs.vout {return false} + if lhs.pubKey != rhs.pubKey {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TXOutputs: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TXOutputs" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "outputs"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.outputs) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.outputs.isEmpty { + try visitor.visitRepeatedMessageField(value: self.outputs, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TXOutputs, rhs: Protocol_TXOutputs) -> Bool { + if lhs.outputs != rhs.outputs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ResourceReceipt: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ResourceReceipt" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "energy_usage"), + 2: .standard(proto: "energy_fee"), + 3: .standard(proto: "origin_energy_usage"), + 4: .standard(proto: "energy_usage_total"), + 5: .standard(proto: "net_usage"), + 6: .standard(proto: "net_fee"), + 7: .same(proto: "result"), + 8: .standard(proto: "energy_penalty_total"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.energyUsage) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.energyFee) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.originEnergyUsage) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.energyUsageTotal) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.netUsage) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.netFee) }() + case 7: try { try decoder.decodeSingularEnumField(value: &self.result) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.energyPenaltyTotal) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.energyUsage != 0 { + try visitor.visitSingularInt64Field(value: self.energyUsage, fieldNumber: 1) + } + if self.energyFee != 0 { + try visitor.visitSingularInt64Field(value: self.energyFee, fieldNumber: 2) + } + if self.originEnergyUsage != 0 { + try visitor.visitSingularInt64Field(value: self.originEnergyUsage, fieldNumber: 3) + } + if self.energyUsageTotal != 0 { + try visitor.visitSingularInt64Field(value: self.energyUsageTotal, fieldNumber: 4) + } + if self.netUsage != 0 { + try visitor.visitSingularInt64Field(value: self.netUsage, fieldNumber: 5) + } + if self.netFee != 0 { + try visitor.visitSingularInt64Field(value: self.netFee, fieldNumber: 6) + } + if self.result != .default { + try visitor.visitSingularEnumField(value: self.result, fieldNumber: 7) + } + if self.energyPenaltyTotal != 0 { + try visitor.visitSingularInt64Field(value: self.energyPenaltyTotal, fieldNumber: 8) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ResourceReceipt, rhs: Protocol_ResourceReceipt) -> Bool { + if lhs.energyUsage != rhs.energyUsage {return false} + if lhs.energyFee != rhs.energyFee {return false} + if lhs.originEnergyUsage != rhs.originEnergyUsage {return false} + if lhs.energyUsageTotal != rhs.energyUsageTotal {return false} + if lhs.netUsage != rhs.netUsage {return false} + if lhs.netFee != rhs.netFee {return false} + if lhs.result != rhs.result {return false} + if lhs.energyPenaltyTotal != rhs.energyPenaltyTotal {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MarketOrderDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketOrderDetail" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "makerOrderId"), + 2: .same(proto: "takerOrderId"), + 3: .same(proto: "fillSellQuantity"), + 4: .same(proto: "fillBuyQuantity"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.makerOrderID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.takerOrderID) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.fillSellQuantity) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.fillBuyQuantity) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.makerOrderID.isEmpty { + try visitor.visitSingularBytesField(value: self.makerOrderID, fieldNumber: 1) + } + if !self.takerOrderID.isEmpty { + try visitor.visitSingularBytesField(value: self.takerOrderID, fieldNumber: 2) + } + if self.fillSellQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.fillSellQuantity, fieldNumber: 3) + } + if self.fillBuyQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.fillBuyQuantity, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MarketOrderDetail, rhs: Protocol_MarketOrderDetail) -> Bool { + if lhs.makerOrderID != rhs.makerOrderID {return false} + if lhs.takerOrderID != rhs.takerOrderID {return false} + if lhs.fillSellQuantity != rhs.fillSellQuantity {return false} + if lhs.fillBuyQuantity != rhs.fillBuyQuantity {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Transaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Transaction" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "raw_data"), + 2: .same(proto: "signature"), + 5: .same(proto: "ret"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._rawData) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.signature) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.ret) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._rawData { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.signature.isEmpty { + try visitor.visitRepeatedBytesField(value: self.signature, fieldNumber: 2) + } + if !self.ret.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ret, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Transaction, rhs: Protocol_Transaction) -> Bool { + if lhs._rawData != rhs._rawData {return false} + if lhs.signature != rhs.signature {return false} + if lhs.ret != rhs.ret {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Transaction.Contract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Transaction.protoMessageName + ".Contract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "parameter"), + 3: .same(proto: "provider"), + 4: .same(proto: "ContractName"), + 5: .standard(proto: "Permission_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._parameter) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.provider) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.contractName) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self.permissionID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.type != .accountCreateContract { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + try { if let v = self._parameter { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.provider.isEmpty { + try visitor.visitSingularBytesField(value: self.provider, fieldNumber: 3) + } + if !self.contractName.isEmpty { + try visitor.visitSingularBytesField(value: self.contractName, fieldNumber: 4) + } + if self.permissionID != 0 { + try visitor.visitSingularInt32Field(value: self.permissionID, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Transaction.Contract, rhs: Protocol_Transaction.Contract) -> Bool { + if lhs.type != rhs.type {return false} + if lhs._parameter != rhs._parameter {return false} + if lhs.provider != rhs.provider {return false} + if lhs.contractName != rhs.contractName {return false} + if lhs.permissionID != rhs.permissionID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Transaction.Contract.ContractType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "AccountCreateContract"), + 1: .same(proto: "TransferContract"), + 2: .same(proto: "TransferAssetContract"), + 3: .same(proto: "VoteAssetContract"), + 4: .same(proto: "VoteWitnessContract"), + 5: .same(proto: "WitnessCreateContract"), + 6: .same(proto: "AssetIssueContract"), + 8: .same(proto: "WitnessUpdateContract"), + 9: .same(proto: "ParticipateAssetIssueContract"), + 10: .same(proto: "AccountUpdateContract"), + 11: .same(proto: "FreezeBalanceContract"), + 12: .same(proto: "UnfreezeBalanceContract"), + 13: .same(proto: "WithdrawBalanceContract"), + 14: .same(proto: "UnfreezeAssetContract"), + 15: .same(proto: "UpdateAssetContract"), + 16: .same(proto: "ProposalCreateContract"), + 17: .same(proto: "ProposalApproveContract"), + 18: .same(proto: "ProposalDeleteContract"), + 19: .same(proto: "SetAccountIdContract"), + 20: .same(proto: "CustomContract"), + 30: .same(proto: "CreateSmartContract"), + 31: .same(proto: "TriggerSmartContract"), + 32: .same(proto: "GetContract"), + 33: .same(proto: "UpdateSettingContract"), + 41: .same(proto: "ExchangeCreateContract"), + 42: .same(proto: "ExchangeInjectContract"), + 43: .same(proto: "ExchangeWithdrawContract"), + 44: .same(proto: "ExchangeTransactionContract"), + 45: .same(proto: "UpdateEnergyLimitContract"), + 46: .same(proto: "AccountPermissionUpdateContract"), + 48: .same(proto: "ClearABIContract"), + 49: .same(proto: "UpdateBrokerageContract"), + 51: .same(proto: "ShieldedTransferContract"), + 52: .same(proto: "MarketSellAssetContract"), + 53: .same(proto: "MarketCancelOrderContract"), + 54: .same(proto: "FreezeBalanceV2Contract"), + 55: .same(proto: "UnfreezeBalanceV2Contract"), + 56: .same(proto: "WithdrawExpireUnfreezeContract"), + 57: .same(proto: "DelegateResourceContract"), + 58: .same(proto: "UnDelegateResourceContract"), + 59: .same(proto: "CancelAllUnfreezeV2Contract"), + ] +} + +extension Protocol_Transaction.Result: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Transaction.protoMessageName + ".Result" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "fee"), + 2: .same(proto: "ret"), + 3: .same(proto: "contractRet"), + 14: .same(proto: "assetIssueID"), + 15: .standard(proto: "withdraw_amount"), + 16: .standard(proto: "unfreeze_amount"), + 18: .standard(proto: "exchange_received_amount"), + 19: .standard(proto: "exchange_inject_another_amount"), + 20: .standard(proto: "exchange_withdraw_another_amount"), + 21: .standard(proto: "exchange_id"), + 22: .standard(proto: "shielded_transaction_fee"), + 25: .same(proto: "orderId"), + 26: .same(proto: "orderDetails"), + 27: .standard(proto: "withdraw_expire_amount"), + 28: .standard(proto: "cancel_unfreezeV2_amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.fee) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.ret) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.contractRet) }() + case 14: try { try decoder.decodeSingularStringField(value: &self.assetIssueID) }() + case 15: try { try decoder.decodeSingularInt64Field(value: &self.withdrawAmount) }() + case 16: try { try decoder.decodeSingularInt64Field(value: &self.unfreezeAmount) }() + case 18: try { try decoder.decodeSingularInt64Field(value: &self.exchangeReceivedAmount) }() + case 19: try { try decoder.decodeSingularInt64Field(value: &self.exchangeInjectAnotherAmount) }() + case 20: try { try decoder.decodeSingularInt64Field(value: &self.exchangeWithdrawAnotherAmount) }() + case 21: try { try decoder.decodeSingularInt64Field(value: &self.exchangeID) }() + case 22: try { try decoder.decodeSingularInt64Field(value: &self.shieldedTransactionFee) }() + case 25: try { try decoder.decodeSingularBytesField(value: &self.orderID) }() + case 26: try { try decoder.decodeRepeatedMessageField(value: &self.orderDetails) }() + case 27: try { try decoder.decodeSingularInt64Field(value: &self.withdrawExpireAmount) }() + case 28: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.cancelUnfreezeV2Amount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.fee != 0 { + try visitor.visitSingularInt64Field(value: self.fee, fieldNumber: 1) + } + if self.ret != .sucess { + try visitor.visitSingularEnumField(value: self.ret, fieldNumber: 2) + } + if self.contractRet != .default { + try visitor.visitSingularEnumField(value: self.contractRet, fieldNumber: 3) + } + if !self.assetIssueID.isEmpty { + try visitor.visitSingularStringField(value: self.assetIssueID, fieldNumber: 14) + } + if self.withdrawAmount != 0 { + try visitor.visitSingularInt64Field(value: self.withdrawAmount, fieldNumber: 15) + } + if self.unfreezeAmount != 0 { + try visitor.visitSingularInt64Field(value: self.unfreezeAmount, fieldNumber: 16) + } + if self.exchangeReceivedAmount != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeReceivedAmount, fieldNumber: 18) + } + if self.exchangeInjectAnotherAmount != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeInjectAnotherAmount, fieldNumber: 19) + } + if self.exchangeWithdrawAnotherAmount != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeWithdrawAnotherAmount, fieldNumber: 20) + } + if self.exchangeID != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeID, fieldNumber: 21) + } + if self.shieldedTransactionFee != 0 { + try visitor.visitSingularInt64Field(value: self.shieldedTransactionFee, fieldNumber: 22) + } + if !self.orderID.isEmpty { + try visitor.visitSingularBytesField(value: self.orderID, fieldNumber: 25) + } + if !self.orderDetails.isEmpty { + try visitor.visitRepeatedMessageField(value: self.orderDetails, fieldNumber: 26) + } + if self.withdrawExpireAmount != 0 { + try visitor.visitSingularInt64Field(value: self.withdrawExpireAmount, fieldNumber: 27) + } + if !self.cancelUnfreezeV2Amount.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.cancelUnfreezeV2Amount, fieldNumber: 28) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Transaction.Result, rhs: Protocol_Transaction.Result) -> Bool { + if lhs.fee != rhs.fee {return false} + if lhs.ret != rhs.ret {return false} + if lhs.contractRet != rhs.contractRet {return false} + if lhs.assetIssueID != rhs.assetIssueID {return false} + if lhs.withdrawAmount != rhs.withdrawAmount {return false} + if lhs.unfreezeAmount != rhs.unfreezeAmount {return false} + if lhs.exchangeReceivedAmount != rhs.exchangeReceivedAmount {return false} + if lhs.exchangeInjectAnotherAmount != rhs.exchangeInjectAnotherAmount {return false} + if lhs.exchangeWithdrawAnotherAmount != rhs.exchangeWithdrawAnotherAmount {return false} + if lhs.exchangeID != rhs.exchangeID {return false} + if lhs.shieldedTransactionFee != rhs.shieldedTransactionFee {return false} + if lhs.orderID != rhs.orderID {return false} + if lhs.orderDetails != rhs.orderDetails {return false} + if lhs.withdrawExpireAmount != rhs.withdrawExpireAmount {return false} + if lhs.cancelUnfreezeV2Amount != rhs.cancelUnfreezeV2Amount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Transaction.Result.code: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SUCESS"), + 1: .same(proto: "FAILED"), + ] +} + +extension Protocol_Transaction.Result.contractResult: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "DEFAULT"), + 1: .same(proto: "SUCCESS"), + 2: .same(proto: "REVERT"), + 3: .same(proto: "BAD_JUMP_DESTINATION"), + 4: .same(proto: "OUT_OF_MEMORY"), + 5: .same(proto: "PRECOMPILED_CONTRACT"), + 6: .same(proto: "STACK_TOO_SMALL"), + 7: .same(proto: "STACK_TOO_LARGE"), + 8: .same(proto: "ILLEGAL_OPERATION"), + 9: .same(proto: "STACK_OVERFLOW"), + 10: .same(proto: "OUT_OF_ENERGY"), + 11: .same(proto: "OUT_OF_TIME"), + 12: .same(proto: "JVM_STACK_OVER_FLOW"), + 13: .same(proto: "UNKNOWN"), + 14: .same(proto: "TRANSFER_FAILED"), + 15: .same(proto: "INVALID_CODE"), + ] +} + +extension Protocol_Transaction.raw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_Transaction.protoMessageName + ".raw" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "ref_block_bytes"), + 3: .standard(proto: "ref_block_num"), + 4: .standard(proto: "ref_block_hash"), + 8: .same(proto: "expiration"), + 9: .same(proto: "auths"), + 10: .same(proto: "data"), + 11: .same(proto: "contract"), + 12: .same(proto: "scripts"), + 14: .same(proto: "timestamp"), + 18: .standard(proto: "fee_limit"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.refBlockBytes) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.refBlockNum) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.refBlockHash) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.expiration) }() + case 9: try { try decoder.decodeRepeatedMessageField(value: &self.auths) }() + case 10: try { try decoder.decodeSingularBytesField(value: &self.data) }() + case 11: try { try decoder.decodeRepeatedMessageField(value: &self.contract) }() + case 12: try { try decoder.decodeSingularBytesField(value: &self.scripts) }() + case 14: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + case 18: try { try decoder.decodeSingularInt64Field(value: &self.feeLimit) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.refBlockBytes.isEmpty { + try visitor.visitSingularBytesField(value: self.refBlockBytes, fieldNumber: 1) + } + if self.refBlockNum != 0 { + try visitor.visitSingularInt64Field(value: self.refBlockNum, fieldNumber: 3) + } + if !self.refBlockHash.isEmpty { + try visitor.visitSingularBytesField(value: self.refBlockHash, fieldNumber: 4) + } + if self.expiration != 0 { + try visitor.visitSingularInt64Field(value: self.expiration, fieldNumber: 8) + } + if !self.auths.isEmpty { + try visitor.visitRepeatedMessageField(value: self.auths, fieldNumber: 9) + } + if !self.data.isEmpty { + try visitor.visitSingularBytesField(value: self.data, fieldNumber: 10) + } + if !self.contract.isEmpty { + try visitor.visitRepeatedMessageField(value: self.contract, fieldNumber: 11) + } + if !self.scripts.isEmpty { + try visitor.visitSingularBytesField(value: self.scripts, fieldNumber: 12) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 14) + } + if self.feeLimit != 0 { + try visitor.visitSingularInt64Field(value: self.feeLimit, fieldNumber: 18) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Transaction.raw, rhs: Protocol_Transaction.raw) -> Bool { + if lhs.refBlockBytes != rhs.refBlockBytes {return false} + if lhs.refBlockNum != rhs.refBlockNum {return false} + if lhs.refBlockHash != rhs.refBlockHash {return false} + if lhs.expiration != rhs.expiration {return false} + if lhs.auths != rhs.auths {return false} + if lhs.data != rhs.data {return false} + if lhs.contract != rhs.contract {return false} + if lhs.scripts != rhs.scripts {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.feeLimit != rhs.feeLimit {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransactionInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TransactionInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "id"), + 2: .same(proto: "fee"), + 3: .same(proto: "blockNumber"), + 4: .same(proto: "blockTimeStamp"), + 5: .same(proto: "contractResult"), + 6: .standard(proto: "contract_address"), + 7: .same(proto: "receipt"), + 8: .same(proto: "log"), + 9: .same(proto: "result"), + 10: .same(proto: "resMessage"), + 14: .same(proto: "assetIssueID"), + 15: .standard(proto: "withdraw_amount"), + 16: .standard(proto: "unfreeze_amount"), + 17: .standard(proto: "internal_transactions"), + 18: .standard(proto: "exchange_received_amount"), + 19: .standard(proto: "exchange_inject_another_amount"), + 20: .standard(proto: "exchange_withdraw_another_amount"), + 21: .standard(proto: "exchange_id"), + 22: .standard(proto: "shielded_transaction_fee"), + 25: .same(proto: "orderId"), + 26: .same(proto: "orderDetails"), + 27: .same(proto: "packingFee"), + 28: .standard(proto: "withdraw_expire_amount"), + 29: .standard(proto: "cancel_unfreezeV2_amount"), + ] + + fileprivate class _StorageClass { + var _id: Data = Data() + var _fee: Int64 = 0 + var _blockNumber: Int64 = 0 + var _blockTimeStamp: Int64 = 0 + var _contractResult: [Data] = [] + var _contractAddress: Data = Data() + var _receipt: Protocol_ResourceReceipt? = nil + var _log: [Protocol_TransactionInfo.Log] = [] + var _result: Protocol_TransactionInfo.code = .sucess + var _resMessage: Data = Data() + var _assetIssueID: String = String() + var _withdrawAmount: Int64 = 0 + var _unfreezeAmount: Int64 = 0 + var _internalTransactions: [Protocol_InternalTransaction] = [] + var _exchangeReceivedAmount: Int64 = 0 + var _exchangeInjectAnotherAmount: Int64 = 0 + var _exchangeWithdrawAnotherAmount: Int64 = 0 + var _exchangeID: Int64 = 0 + var _shieldedTransactionFee: Int64 = 0 + var _orderID: Data = Data() + var _orderDetails: [Protocol_MarketOrderDetail] = [] + var _packingFee: Int64 = 0 + var _withdrawExpireAmount: Int64 = 0 + var _cancelUnfreezeV2Amount: Dictionary = [:] + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _id = source._id + _fee = source._fee + _blockNumber = source._blockNumber + _blockTimeStamp = source._blockTimeStamp + _contractResult = source._contractResult + _contractAddress = source._contractAddress + _receipt = source._receipt + _log = source._log + _result = source._result + _resMessage = source._resMessage + _assetIssueID = source._assetIssueID + _withdrawAmount = source._withdrawAmount + _unfreezeAmount = source._unfreezeAmount + _internalTransactions = source._internalTransactions + _exchangeReceivedAmount = source._exchangeReceivedAmount + _exchangeInjectAnotherAmount = source._exchangeInjectAnotherAmount + _exchangeWithdrawAnotherAmount = source._exchangeWithdrawAnotherAmount + _exchangeID = source._exchangeID + _shieldedTransactionFee = source._shieldedTransactionFee + _orderID = source._orderID + _orderDetails = source._orderDetails + _packingFee = source._packingFee + _withdrawExpireAmount = source._withdrawExpireAmount + _cancelUnfreezeV2Amount = source._cancelUnfreezeV2Amount + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &_storage._id) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._fee) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._blockNumber) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._blockTimeStamp) }() + case 5: try { try decoder.decodeRepeatedBytesField(value: &_storage._contractResult) }() + case 6: try { try decoder.decodeSingularBytesField(value: &_storage._contractAddress) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._receipt) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &_storage._log) }() + case 9: try { try decoder.decodeSingularEnumField(value: &_storage._result) }() + case 10: try { try decoder.decodeSingularBytesField(value: &_storage._resMessage) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._assetIssueID) }() + case 15: try { try decoder.decodeSingularInt64Field(value: &_storage._withdrawAmount) }() + case 16: try { try decoder.decodeSingularInt64Field(value: &_storage._unfreezeAmount) }() + case 17: try { try decoder.decodeRepeatedMessageField(value: &_storage._internalTransactions) }() + case 18: try { try decoder.decodeSingularInt64Field(value: &_storage._exchangeReceivedAmount) }() + case 19: try { try decoder.decodeSingularInt64Field(value: &_storage._exchangeInjectAnotherAmount) }() + case 20: try { try decoder.decodeSingularInt64Field(value: &_storage._exchangeWithdrawAnotherAmount) }() + case 21: try { try decoder.decodeSingularInt64Field(value: &_storage._exchangeID) }() + case 22: try { try decoder.decodeSingularInt64Field(value: &_storage._shieldedTransactionFee) }() + case 25: try { try decoder.decodeSingularBytesField(value: &_storage._orderID) }() + case 26: try { try decoder.decodeRepeatedMessageField(value: &_storage._orderDetails) }() + case 27: try { try decoder.decodeSingularInt64Field(value: &_storage._packingFee) }() + case 28: try { try decoder.decodeSingularInt64Field(value: &_storage._withdrawExpireAmount) }() + case 29: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._cancelUnfreezeV2Amount) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !_storage._id.isEmpty { + try visitor.visitSingularBytesField(value: _storage._id, fieldNumber: 1) + } + if _storage._fee != 0 { + try visitor.visitSingularInt64Field(value: _storage._fee, fieldNumber: 2) + } + if _storage._blockNumber != 0 { + try visitor.visitSingularInt64Field(value: _storage._blockNumber, fieldNumber: 3) + } + if _storage._blockTimeStamp != 0 { + try visitor.visitSingularInt64Field(value: _storage._blockTimeStamp, fieldNumber: 4) + } + if !_storage._contractResult.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._contractResult, fieldNumber: 5) + } + if !_storage._contractAddress.isEmpty { + try visitor.visitSingularBytesField(value: _storage._contractAddress, fieldNumber: 6) + } + try { if let v = _storage._receipt { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + if !_storage._log.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._log, fieldNumber: 8) + } + if _storage._result != .sucess { + try visitor.visitSingularEnumField(value: _storage._result, fieldNumber: 9) + } + if !_storage._resMessage.isEmpty { + try visitor.visitSingularBytesField(value: _storage._resMessage, fieldNumber: 10) + } + if !_storage._assetIssueID.isEmpty { + try visitor.visitSingularStringField(value: _storage._assetIssueID, fieldNumber: 14) + } + if _storage._withdrawAmount != 0 { + try visitor.visitSingularInt64Field(value: _storage._withdrawAmount, fieldNumber: 15) + } + if _storage._unfreezeAmount != 0 { + try visitor.visitSingularInt64Field(value: _storage._unfreezeAmount, fieldNumber: 16) + } + if !_storage._internalTransactions.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._internalTransactions, fieldNumber: 17) + } + if _storage._exchangeReceivedAmount != 0 { + try visitor.visitSingularInt64Field(value: _storage._exchangeReceivedAmount, fieldNumber: 18) + } + if _storage._exchangeInjectAnotherAmount != 0 { + try visitor.visitSingularInt64Field(value: _storage._exchangeInjectAnotherAmount, fieldNumber: 19) + } + if _storage._exchangeWithdrawAnotherAmount != 0 { + try visitor.visitSingularInt64Field(value: _storage._exchangeWithdrawAnotherAmount, fieldNumber: 20) + } + if _storage._exchangeID != 0 { + try visitor.visitSingularInt64Field(value: _storage._exchangeID, fieldNumber: 21) + } + if _storage._shieldedTransactionFee != 0 { + try visitor.visitSingularInt64Field(value: _storage._shieldedTransactionFee, fieldNumber: 22) + } + if !_storage._orderID.isEmpty { + try visitor.visitSingularBytesField(value: _storage._orderID, fieldNumber: 25) + } + if !_storage._orderDetails.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._orderDetails, fieldNumber: 26) + } + if _storage._packingFee != 0 { + try visitor.visitSingularInt64Field(value: _storage._packingFee, fieldNumber: 27) + } + if _storage._withdrawExpireAmount != 0 { + try visitor.visitSingularInt64Field(value: _storage._withdrawExpireAmount, fieldNumber: 28) + } + if !_storage._cancelUnfreezeV2Amount.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._cancelUnfreezeV2Amount, fieldNumber: 29) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransactionInfo, rhs: Protocol_TransactionInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._id != rhs_storage._id {return false} + if _storage._fee != rhs_storage._fee {return false} + if _storage._blockNumber != rhs_storage._blockNumber {return false} + if _storage._blockTimeStamp != rhs_storage._blockTimeStamp {return false} + if _storage._contractResult != rhs_storage._contractResult {return false} + if _storage._contractAddress != rhs_storage._contractAddress {return false} + if _storage._receipt != rhs_storage._receipt {return false} + if _storage._log != rhs_storage._log {return false} + if _storage._result != rhs_storage._result {return false} + if _storage._resMessage != rhs_storage._resMessage {return false} + if _storage._assetIssueID != rhs_storage._assetIssueID {return false} + if _storage._withdrawAmount != rhs_storage._withdrawAmount {return false} + if _storage._unfreezeAmount != rhs_storage._unfreezeAmount {return false} + if _storage._internalTransactions != rhs_storage._internalTransactions {return false} + if _storage._exchangeReceivedAmount != rhs_storage._exchangeReceivedAmount {return false} + if _storage._exchangeInjectAnotherAmount != rhs_storage._exchangeInjectAnotherAmount {return false} + if _storage._exchangeWithdrawAnotherAmount != rhs_storage._exchangeWithdrawAnotherAmount {return false} + if _storage._exchangeID != rhs_storage._exchangeID {return false} + if _storage._shieldedTransactionFee != rhs_storage._shieldedTransactionFee {return false} + if _storage._orderID != rhs_storage._orderID {return false} + if _storage._orderDetails != rhs_storage._orderDetails {return false} + if _storage._packingFee != rhs_storage._packingFee {return false} + if _storage._withdrawExpireAmount != rhs_storage._withdrawExpireAmount {return false} + if _storage._cancelUnfreezeV2Amount != rhs_storage._cancelUnfreezeV2Amount {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransactionInfo.code: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SUCESS"), + 1: .same(proto: "FAILED"), + ] +} + +extension Protocol_TransactionInfo.Log: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_TransactionInfo.protoMessageName + ".Log" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "address"), + 2: .same(proto: "topics"), + 3: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.topics) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 1) + } + if !self.topics.isEmpty { + try visitor.visitRepeatedBytesField(value: self.topics, fieldNumber: 2) + } + if !self.data.isEmpty { + try visitor.visitSingularBytesField(value: self.data, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransactionInfo.Log, rhs: Protocol_TransactionInfo.Log) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.topics != rhs.topics {return false} + if lhs.data != rhs.data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransactionRet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TransactionRet" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "blockNumber"), + 2: .same(proto: "blockTimeStamp"), + 3: .same(proto: "transactioninfo"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.blockNumber) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.blockTimeStamp) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.transactioninfo) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.blockNumber != 0 { + try visitor.visitSingularInt64Field(value: self.blockNumber, fieldNumber: 1) + } + if self.blockTimeStamp != 0 { + try visitor.visitSingularInt64Field(value: self.blockTimeStamp, fieldNumber: 2) + } + if !self.transactioninfo.isEmpty { + try visitor.visitRepeatedMessageField(value: self.transactioninfo, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransactionRet, rhs: Protocol_TransactionRet) -> Bool { + if lhs.blockNumber != rhs.blockNumber {return false} + if lhs.blockTimeStamp != rhs.blockTimeStamp {return false} + if lhs.transactioninfo != rhs.transactioninfo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Transactions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Transactions" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "transactions"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.transactions) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.transactions.isEmpty { + try visitor.visitRepeatedMessageField(value: self.transactions, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Transactions, rhs: Protocol_Transactions) -> Bool { + if lhs.transactions != rhs.transactions {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BlockHeader: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BlockHeader" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "raw_data"), + 2: .standard(proto: "witness_signature"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._rawData) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.witnessSignature) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._rawData { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.witnessSignature.isEmpty { + try visitor.visitSingularBytesField(value: self.witnessSignature, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BlockHeader, rhs: Protocol_BlockHeader) -> Bool { + if lhs._rawData != rhs._rawData {return false} + if lhs.witnessSignature != rhs.witnessSignature {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BlockHeader.raw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_BlockHeader.protoMessageName + ".raw" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "timestamp"), + 2: .same(proto: "txTrieRoot"), + 3: .same(proto: "parentHash"), + 7: .same(proto: "number"), + 8: .standard(proto: "witness_id"), + 9: .standard(proto: "witness_address"), + 10: .same(proto: "version"), + 11: .same(proto: "accountStateRoot"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.txTrieRoot) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.parentHash) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.number) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.witnessID) }() + case 9: try { try decoder.decodeSingularBytesField(value: &self.witnessAddress) }() + case 10: try { try decoder.decodeSingularInt32Field(value: &self.version) }() + case 11: try { try decoder.decodeSingularBytesField(value: &self.accountStateRoot) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 1) + } + if !self.txTrieRoot.isEmpty { + try visitor.visitSingularBytesField(value: self.txTrieRoot, fieldNumber: 2) + } + if !self.parentHash.isEmpty { + try visitor.visitSingularBytesField(value: self.parentHash, fieldNumber: 3) + } + if self.number != 0 { + try visitor.visitSingularInt64Field(value: self.number, fieldNumber: 7) + } + if self.witnessID != 0 { + try visitor.visitSingularInt64Field(value: self.witnessID, fieldNumber: 8) + } + if !self.witnessAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.witnessAddress, fieldNumber: 9) + } + if self.version != 0 { + try visitor.visitSingularInt32Field(value: self.version, fieldNumber: 10) + } + if !self.accountStateRoot.isEmpty { + try visitor.visitSingularBytesField(value: self.accountStateRoot, fieldNumber: 11) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BlockHeader.raw, rhs: Protocol_BlockHeader.raw) -> Bool { + if lhs.timestamp != rhs.timestamp {return false} + if lhs.txTrieRoot != rhs.txTrieRoot {return false} + if lhs.parentHash != rhs.parentHash {return false} + if lhs.number != rhs.number {return false} + if lhs.witnessID != rhs.witnessID {return false} + if lhs.witnessAddress != rhs.witnessAddress {return false} + if lhs.version != rhs.version {return false} + if lhs.accountStateRoot != rhs.accountStateRoot {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Block: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Block" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "transactions"), + 2: .standard(proto: "block_header"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.transactions) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._blockHeader) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.transactions.isEmpty { + try visitor.visitRepeatedMessageField(value: self.transactions, fieldNumber: 1) + } + try { if let v = self._blockHeader { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Block, rhs: Protocol_Block) -> Bool { + if lhs.transactions != rhs.transactions {return false} + if lhs._blockHeader != rhs._blockHeader {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ChainInventory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ChainInventory" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "ids"), + 2: .standard(proto: "remain_num"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.ids) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.remainNum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ids.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ids, fieldNumber: 1) + } + if self.remainNum != 0 { + try visitor.visitSingularInt64Field(value: self.remainNum, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ChainInventory, rhs: Protocol_ChainInventory) -> Bool { + if lhs.ids != rhs.ids {return false} + if lhs.remainNum != rhs.remainNum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ChainInventory.BlockId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_ChainInventory.protoMessageName + ".BlockId" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "hash"), + 2: .same(proto: "number"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.hash) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.number) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.hash.isEmpty { + try visitor.visitSingularBytesField(value: self.hash, fieldNumber: 1) + } + if self.number != 0 { + try visitor.visitSingularInt64Field(value: self.number, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ChainInventory.BlockId, rhs: Protocol_ChainInventory.BlockId) -> Bool { + if lhs.hash != rhs.hash {return false} + if lhs.number != rhs.number {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BlockInventory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BlockInventory" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "ids"), + 2: .same(proto: "type"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.ids) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.type) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ids.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ids, fieldNumber: 1) + } + if self.type != .sync { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BlockInventory, rhs: Protocol_BlockInventory) -> Bool { + if lhs.ids != rhs.ids {return false} + if lhs.type != rhs.type {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BlockInventory.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SYNC"), + 1: .same(proto: "ADVTISE"), + 2: .same(proto: "FETCH"), + ] +} + +extension Protocol_BlockInventory.BlockId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_BlockInventory.protoMessageName + ".BlockId" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "hash"), + 2: .same(proto: "number"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.hash) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.number) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.hash.isEmpty { + try visitor.visitSingularBytesField(value: self.hash, fieldNumber: 1) + } + if self.number != 0 { + try visitor.visitSingularInt64Field(value: self.number, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BlockInventory.BlockId, rhs: Protocol_BlockInventory.BlockId) -> Bool { + if lhs.hash != rhs.hash {return false} + if lhs.number != rhs.number {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Inventory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Inventory" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "ids"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.ids) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != .trx { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + if !self.ids.isEmpty { + try visitor.visitRepeatedBytesField(value: self.ids, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Inventory, rhs: Protocol_Inventory) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.ids != rhs.ids {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Inventory.InventoryType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "TRX"), + 1: .same(proto: "BLOCK"), + ] +} + +extension Protocol_Items: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Items" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "blocks"), + 3: .standard(proto: "block_headers"), + 4: .same(proto: "transactions"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.blocks) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.blockHeaders) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.transactions) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != .err { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + } + if !self.blocks.isEmpty { + try visitor.visitRepeatedMessageField(value: self.blocks, fieldNumber: 2) + } + if !self.blockHeaders.isEmpty { + try visitor.visitRepeatedMessageField(value: self.blockHeaders, fieldNumber: 3) + } + if !self.transactions.isEmpty { + try visitor.visitRepeatedMessageField(value: self.transactions, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_Items, rhs: Protocol_Items) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.blocks != rhs.blocks {return false} + if lhs.blockHeaders != rhs.blockHeaders {return false} + if lhs.transactions != rhs.transactions {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_Items.ItemType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ERR"), + 1: .same(proto: "TRX"), + 2: .same(proto: "BLOCK"), + 3: .same(proto: "BLOCKHEADER"), + ] +} + +extension Protocol_DynamicProperties: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DynamicProperties" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "last_solidity_block_num"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.lastSolidityBlockNum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.lastSolidityBlockNum != 0 { + try visitor.visitSingularInt64Field(value: self.lastSolidityBlockNum, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_DynamicProperties, rhs: Protocol_DynamicProperties) -> Bool { + if lhs.lastSolidityBlockNum != rhs.lastSolidityBlockNum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_DisconnectMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DisconnectMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "reason"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.reason) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.reason != .requested { + try visitor.visitSingularEnumField(value: self.reason, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_DisconnectMessage, rhs: Protocol_DisconnectMessage) -> Bool { + if lhs.reason != rhs.reason {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_HelloMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".HelloMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "from"), + 2: .same(proto: "version"), + 3: .same(proto: "timestamp"), + 4: .same(proto: "genesisBlockId"), + 5: .same(proto: "solidBlockId"), + 6: .same(proto: "headBlockId"), + 7: .same(proto: "address"), + 8: .same(proto: "signature"), + 9: .same(proto: "nodeType"), + 10: .same(proto: "lowestBlockNum"), + 11: .same(proto: "codeVersion"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._from) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.version) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._genesisBlockID) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._solidBlockID) }() + case 6: try { try decoder.decodeSingularMessageField(value: &self._headBlockID) }() + case 7: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 8: try { try decoder.decodeSingularBytesField(value: &self.signature) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &self.nodeType) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &self.lowestBlockNum) }() + case 11: try { try decoder.decodeSingularBytesField(value: &self.codeVersion) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._from { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.version != 0 { + try visitor.visitSingularInt32Field(value: self.version, fieldNumber: 2) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 3) + } + try { if let v = self._genesisBlockID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = self._solidBlockID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = self._headBlockID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 7) + } + if !self.signature.isEmpty { + try visitor.visitSingularBytesField(value: self.signature, fieldNumber: 8) + } + if self.nodeType != 0 { + try visitor.visitSingularInt32Field(value: self.nodeType, fieldNumber: 9) + } + if self.lowestBlockNum != 0 { + try visitor.visitSingularInt64Field(value: self.lowestBlockNum, fieldNumber: 10) + } + if !self.codeVersion.isEmpty { + try visitor.visitSingularBytesField(value: self.codeVersion, fieldNumber: 11) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_HelloMessage, rhs: Protocol_HelloMessage) -> Bool { + if lhs._from != rhs._from {return false} + if lhs.version != rhs.version {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs._genesisBlockID != rhs._genesisBlockID {return false} + if lhs._solidBlockID != rhs._solidBlockID {return false} + if lhs._headBlockID != rhs._headBlockID {return false} + if lhs.address != rhs.address {return false} + if lhs.signature != rhs.signature {return false} + if lhs.nodeType != rhs.nodeType {return false} + if lhs.lowestBlockNum != rhs.lowestBlockNum {return false} + if lhs.codeVersion != rhs.codeVersion {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_HelloMessage.BlockId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_HelloMessage.protoMessageName + ".BlockId" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "hash"), + 2: .same(proto: "number"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.hash) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.number) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.hash.isEmpty { + try visitor.visitSingularBytesField(value: self.hash, fieldNumber: 1) + } + if self.number != 0 { + try visitor.visitSingularInt64Field(value: self.number, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_HelloMessage.BlockId, rhs: Protocol_HelloMessage.BlockId) -> Bool { + if lhs.hash != rhs.hash {return false} + if lhs.number != rhs.number {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_InternalTransaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".InternalTransaction" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "hash"), + 2: .standard(proto: "caller_address"), + 3: .standard(proto: "transferTo_address"), + 4: .same(proto: "callValueInfo"), + 5: .same(proto: "note"), + 6: .same(proto: "rejected"), + 7: .same(proto: "extra"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.hash) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.callerAddress) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.transferToAddress) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.callValueInfo) }() + case 5: try { try decoder.decodeSingularBytesField(value: &self.note) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self.rejected) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.extra) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.hash.isEmpty { + try visitor.visitSingularBytesField(value: self.hash, fieldNumber: 1) + } + if !self.callerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.callerAddress, fieldNumber: 2) + } + if !self.transferToAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.transferToAddress, fieldNumber: 3) + } + if !self.callValueInfo.isEmpty { + try visitor.visitRepeatedMessageField(value: self.callValueInfo, fieldNumber: 4) + } + if !self.note.isEmpty { + try visitor.visitSingularBytesField(value: self.note, fieldNumber: 5) + } + if self.rejected != false { + try visitor.visitSingularBoolField(value: self.rejected, fieldNumber: 6) + } + if !self.extra.isEmpty { + try visitor.visitSingularStringField(value: self.extra, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_InternalTransaction, rhs: Protocol_InternalTransaction) -> Bool { + if lhs.hash != rhs.hash {return false} + if lhs.callerAddress != rhs.callerAddress {return false} + if lhs.transferToAddress != rhs.transferToAddress {return false} + if lhs.callValueInfo != rhs.callValueInfo {return false} + if lhs.note != rhs.note {return false} + if lhs.rejected != rhs.rejected {return false} + if lhs.extra != rhs.extra {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_InternalTransaction.CallValueInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_InternalTransaction.protoMessageName + ".CallValueInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "callValue"), + 2: .same(proto: "tokenId"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.callValue) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.tokenID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.callValue != 0 { + try visitor.visitSingularInt64Field(value: self.callValue, fieldNumber: 1) + } + if !self.tokenID.isEmpty { + try visitor.visitSingularStringField(value: self.tokenID, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_InternalTransaction.CallValueInfo, rhs: Protocol_InternalTransaction.CallValueInfo) -> Bool { + if lhs.callValue != rhs.callValue {return false} + if lhs.tokenID != rhs.tokenID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_DelegatedResourceAccountIndex: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DelegatedResourceAccountIndex" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "account"), + 2: .same(proto: "fromAccounts"), + 3: .same(proto: "toAccounts"), + 4: .same(proto: "timestamp"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.account) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.fromAccounts) }() + case 3: try { try decoder.decodeRepeatedBytesField(value: &self.toAccounts) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.account.isEmpty { + try visitor.visitSingularBytesField(value: self.account, fieldNumber: 1) + } + if !self.fromAccounts.isEmpty { + try visitor.visitRepeatedBytesField(value: self.fromAccounts, fieldNumber: 2) + } + if !self.toAccounts.isEmpty { + try visitor.visitRepeatedBytesField(value: self.toAccounts, fieldNumber: 3) + } + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_DelegatedResourceAccountIndex, rhs: Protocol_DelegatedResourceAccountIndex) -> Bool { + if lhs.account != rhs.account {return false} + if lhs.fromAccounts != rhs.fromAccounts {return false} + if lhs.toAccounts != rhs.toAccounts {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_NodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NodeInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "beginSyncNum"), + 2: .same(proto: "block"), + 3: .same(proto: "solidityBlock"), + 4: .same(proto: "currentConnectCount"), + 5: .same(proto: "activeConnectCount"), + 6: .same(proto: "passiveConnectCount"), + 7: .same(proto: "totalFlow"), + 8: .same(proto: "peerInfoList"), + 9: .same(proto: "configNodeInfo"), + 10: .same(proto: "machineInfo"), + 11: .same(proto: "cheatWitnessInfoMap"), + ] + + fileprivate class _StorageClass { + var _beginSyncNum: Int64 = 0 + var _block: String = String() + var _solidityBlock: String = String() + var _currentConnectCount: Int32 = 0 + var _activeConnectCount: Int32 = 0 + var _passiveConnectCount: Int32 = 0 + var _totalFlow: Int64 = 0 + var _peerInfoList: [Protocol_NodeInfo.PeerInfo] = [] + var _configNodeInfo: Protocol_NodeInfo.ConfigNodeInfo? = nil + var _machineInfo: Protocol_NodeInfo.MachineInfo? = nil + var _cheatWitnessInfoMap: Dictionary = [:] + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _beginSyncNum = source._beginSyncNum + _block = source._block + _solidityBlock = source._solidityBlock + _currentConnectCount = source._currentConnectCount + _activeConnectCount = source._activeConnectCount + _passiveConnectCount = source._passiveConnectCount + _totalFlow = source._totalFlow + _peerInfoList = source._peerInfoList + _configNodeInfo = source._configNodeInfo + _machineInfo = source._machineInfo + _cheatWitnessInfoMap = source._cheatWitnessInfoMap + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._beginSyncNum) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._block) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._solidityBlock) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._currentConnectCount) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._activeConnectCount) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._passiveConnectCount) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &_storage._totalFlow) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &_storage._peerInfoList) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._configNodeInfo) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._machineInfo) }() + case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._cheatWitnessInfoMap) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._beginSyncNum != 0 { + try visitor.visitSingularInt64Field(value: _storage._beginSyncNum, fieldNumber: 1) + } + if !_storage._block.isEmpty { + try visitor.visitSingularStringField(value: _storage._block, fieldNumber: 2) + } + if !_storage._solidityBlock.isEmpty { + try visitor.visitSingularStringField(value: _storage._solidityBlock, fieldNumber: 3) + } + if _storage._currentConnectCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._currentConnectCount, fieldNumber: 4) + } + if _storage._activeConnectCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._activeConnectCount, fieldNumber: 5) + } + if _storage._passiveConnectCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._passiveConnectCount, fieldNumber: 6) + } + if _storage._totalFlow != 0 { + try visitor.visitSingularInt64Field(value: _storage._totalFlow, fieldNumber: 7) + } + if !_storage._peerInfoList.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._peerInfoList, fieldNumber: 8) + } + try { if let v = _storage._configNodeInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._machineInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + if !_storage._cheatWitnessInfoMap.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._cheatWitnessInfoMap, fieldNumber: 11) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_NodeInfo, rhs: Protocol_NodeInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._beginSyncNum != rhs_storage._beginSyncNum {return false} + if _storage._block != rhs_storage._block {return false} + if _storage._solidityBlock != rhs_storage._solidityBlock {return false} + if _storage._currentConnectCount != rhs_storage._currentConnectCount {return false} + if _storage._activeConnectCount != rhs_storage._activeConnectCount {return false} + if _storage._passiveConnectCount != rhs_storage._passiveConnectCount {return false} + if _storage._totalFlow != rhs_storage._totalFlow {return false} + if _storage._peerInfoList != rhs_storage._peerInfoList {return false} + if _storage._configNodeInfo != rhs_storage._configNodeInfo {return false} + if _storage._machineInfo != rhs_storage._machineInfo {return false} + if _storage._cheatWitnessInfoMap != rhs_storage._cheatWitnessInfoMap {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_NodeInfo.PeerInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_NodeInfo.protoMessageName + ".PeerInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "lastSyncBlock"), + 2: .same(proto: "remainNum"), + 3: .same(proto: "lastBlockUpdateTime"), + 4: .same(proto: "syncFlag"), + 5: .same(proto: "headBlockTimeWeBothHave"), + 6: .same(proto: "needSyncFromPeer"), + 7: .same(proto: "needSyncFromUs"), + 8: .same(proto: "host"), + 9: .same(proto: "port"), + 10: .same(proto: "nodeId"), + 11: .same(proto: "connectTime"), + 12: .same(proto: "avgLatency"), + 13: .same(proto: "syncToFetchSize"), + 14: .same(proto: "syncToFetchSizePeekNum"), + 15: .same(proto: "syncBlockRequestedSize"), + 16: .same(proto: "unFetchSynNum"), + 17: .same(proto: "blockInPorcSize"), + 18: .same(proto: "headBlockWeBothHave"), + 19: .same(proto: "isActive"), + 20: .same(proto: "score"), + 21: .same(proto: "nodeCount"), + 22: .same(proto: "inFlow"), + 23: .same(proto: "disconnectTimes"), + 24: .same(proto: "localDisconnectReason"), + 25: .same(proto: "remoteDisconnectReason"), + ] + + fileprivate class _StorageClass { + var _lastSyncBlock: String = String() + var _remainNum: Int64 = 0 + var _lastBlockUpdateTime: Int64 = 0 + var _syncFlag: Bool = false + var _headBlockTimeWeBothHave: Int64 = 0 + var _needSyncFromPeer: Bool = false + var _needSyncFromUs: Bool = false + var _host: String = String() + var _port: Int32 = 0 + var _nodeID: String = String() + var _connectTime: Int64 = 0 + var _avgLatency: Double = 0 + var _syncToFetchSize: Int32 = 0 + var _syncToFetchSizePeekNum: Int64 = 0 + var _syncBlockRequestedSize: Int32 = 0 + var _unFetchSynNum: Int64 = 0 + var _blockInPorcSize: Int32 = 0 + var _headBlockWeBothHave: String = String() + var _isActive: Bool = false + var _score: Int32 = 0 + var _nodeCount: Int32 = 0 + var _inFlow: Int64 = 0 + var _disconnectTimes: Int32 = 0 + var _localDisconnectReason: String = String() + var _remoteDisconnectReason: String = String() + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _lastSyncBlock = source._lastSyncBlock + _remainNum = source._remainNum + _lastBlockUpdateTime = source._lastBlockUpdateTime + _syncFlag = source._syncFlag + _headBlockTimeWeBothHave = source._headBlockTimeWeBothHave + _needSyncFromPeer = source._needSyncFromPeer + _needSyncFromUs = source._needSyncFromUs + _host = source._host + _port = source._port + _nodeID = source._nodeID + _connectTime = source._connectTime + _avgLatency = source._avgLatency + _syncToFetchSize = source._syncToFetchSize + _syncToFetchSizePeekNum = source._syncToFetchSizePeekNum + _syncBlockRequestedSize = source._syncBlockRequestedSize + _unFetchSynNum = source._unFetchSynNum + _blockInPorcSize = source._blockInPorcSize + _headBlockWeBothHave = source._headBlockWeBothHave + _isActive = source._isActive + _score = source._score + _nodeCount = source._nodeCount + _inFlow = source._inFlow + _disconnectTimes = source._disconnectTimes + _localDisconnectReason = source._localDisconnectReason + _remoteDisconnectReason = source._remoteDisconnectReason + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._lastSyncBlock) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._remainNum) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &_storage._lastBlockUpdateTime) }() + case 4: try { try decoder.decodeSingularBoolField(value: &_storage._syncFlag) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._headBlockTimeWeBothHave) }() + case 6: try { try decoder.decodeSingularBoolField(value: &_storage._needSyncFromPeer) }() + case 7: try { try decoder.decodeSingularBoolField(value: &_storage._needSyncFromUs) }() + case 8: try { try decoder.decodeSingularStringField(value: &_storage._host) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._port) }() + case 10: try { try decoder.decodeSingularStringField(value: &_storage._nodeID) }() + case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._connectTime) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._avgLatency) }() + case 13: try { try decoder.decodeSingularInt32Field(value: &_storage._syncToFetchSize) }() + case 14: try { try decoder.decodeSingularInt64Field(value: &_storage._syncToFetchSizePeekNum) }() + case 15: try { try decoder.decodeSingularInt32Field(value: &_storage._syncBlockRequestedSize) }() + case 16: try { try decoder.decodeSingularInt64Field(value: &_storage._unFetchSynNum) }() + case 17: try { try decoder.decodeSingularInt32Field(value: &_storage._blockInPorcSize) }() + case 18: try { try decoder.decodeSingularStringField(value: &_storage._headBlockWeBothHave) }() + case 19: try { try decoder.decodeSingularBoolField(value: &_storage._isActive) }() + case 20: try { try decoder.decodeSingularInt32Field(value: &_storage._score) }() + case 21: try { try decoder.decodeSingularInt32Field(value: &_storage._nodeCount) }() + case 22: try { try decoder.decodeSingularInt64Field(value: &_storage._inFlow) }() + case 23: try { try decoder.decodeSingularInt32Field(value: &_storage._disconnectTimes) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._localDisconnectReason) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._remoteDisconnectReason) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._lastSyncBlock.isEmpty { + try visitor.visitSingularStringField(value: _storage._lastSyncBlock, fieldNumber: 1) + } + if _storage._remainNum != 0 { + try visitor.visitSingularInt64Field(value: _storage._remainNum, fieldNumber: 2) + } + if _storage._lastBlockUpdateTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._lastBlockUpdateTime, fieldNumber: 3) + } + if _storage._syncFlag != false { + try visitor.visitSingularBoolField(value: _storage._syncFlag, fieldNumber: 4) + } + if _storage._headBlockTimeWeBothHave != 0 { + try visitor.visitSingularInt64Field(value: _storage._headBlockTimeWeBothHave, fieldNumber: 5) + } + if _storage._needSyncFromPeer != false { + try visitor.visitSingularBoolField(value: _storage._needSyncFromPeer, fieldNumber: 6) + } + if _storage._needSyncFromUs != false { + try visitor.visitSingularBoolField(value: _storage._needSyncFromUs, fieldNumber: 7) + } + if !_storage._host.isEmpty { + try visitor.visitSingularStringField(value: _storage._host, fieldNumber: 8) + } + if _storage._port != 0 { + try visitor.visitSingularInt32Field(value: _storage._port, fieldNumber: 9) + } + if !_storage._nodeID.isEmpty { + try visitor.visitSingularStringField(value: _storage._nodeID, fieldNumber: 10) + } + if _storage._connectTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._connectTime, fieldNumber: 11) + } + if _storage._avgLatency.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: _storage._avgLatency, fieldNumber: 12) + } + if _storage._syncToFetchSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._syncToFetchSize, fieldNumber: 13) + } + if _storage._syncToFetchSizePeekNum != 0 { + try visitor.visitSingularInt64Field(value: _storage._syncToFetchSizePeekNum, fieldNumber: 14) + } + if _storage._syncBlockRequestedSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._syncBlockRequestedSize, fieldNumber: 15) + } + if _storage._unFetchSynNum != 0 { + try visitor.visitSingularInt64Field(value: _storage._unFetchSynNum, fieldNumber: 16) + } + if _storage._blockInPorcSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._blockInPorcSize, fieldNumber: 17) + } + if !_storage._headBlockWeBothHave.isEmpty { + try visitor.visitSingularStringField(value: _storage._headBlockWeBothHave, fieldNumber: 18) + } + if _storage._isActive != false { + try visitor.visitSingularBoolField(value: _storage._isActive, fieldNumber: 19) + } + if _storage._score != 0 { + try visitor.visitSingularInt32Field(value: _storage._score, fieldNumber: 20) + } + if _storage._nodeCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._nodeCount, fieldNumber: 21) + } + if _storage._inFlow != 0 { + try visitor.visitSingularInt64Field(value: _storage._inFlow, fieldNumber: 22) + } + if _storage._disconnectTimes != 0 { + try visitor.visitSingularInt32Field(value: _storage._disconnectTimes, fieldNumber: 23) + } + if !_storage._localDisconnectReason.isEmpty { + try visitor.visitSingularStringField(value: _storage._localDisconnectReason, fieldNumber: 24) + } + if !_storage._remoteDisconnectReason.isEmpty { + try visitor.visitSingularStringField(value: _storage._remoteDisconnectReason, fieldNumber: 25) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_NodeInfo.PeerInfo, rhs: Protocol_NodeInfo.PeerInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._lastSyncBlock != rhs_storage._lastSyncBlock {return false} + if _storage._remainNum != rhs_storage._remainNum {return false} + if _storage._lastBlockUpdateTime != rhs_storage._lastBlockUpdateTime {return false} + if _storage._syncFlag != rhs_storage._syncFlag {return false} + if _storage._headBlockTimeWeBothHave != rhs_storage._headBlockTimeWeBothHave {return false} + if _storage._needSyncFromPeer != rhs_storage._needSyncFromPeer {return false} + if _storage._needSyncFromUs != rhs_storage._needSyncFromUs {return false} + if _storage._host != rhs_storage._host {return false} + if _storage._port != rhs_storage._port {return false} + if _storage._nodeID != rhs_storage._nodeID {return false} + if _storage._connectTime != rhs_storage._connectTime {return false} + if _storage._avgLatency != rhs_storage._avgLatency {return false} + if _storage._syncToFetchSize != rhs_storage._syncToFetchSize {return false} + if _storage._syncToFetchSizePeekNum != rhs_storage._syncToFetchSizePeekNum {return false} + if _storage._syncBlockRequestedSize != rhs_storage._syncBlockRequestedSize {return false} + if _storage._unFetchSynNum != rhs_storage._unFetchSynNum {return false} + if _storage._blockInPorcSize != rhs_storage._blockInPorcSize {return false} + if _storage._headBlockWeBothHave != rhs_storage._headBlockWeBothHave {return false} + if _storage._isActive != rhs_storage._isActive {return false} + if _storage._score != rhs_storage._score {return false} + if _storage._nodeCount != rhs_storage._nodeCount {return false} + if _storage._inFlow != rhs_storage._inFlow {return false} + if _storage._disconnectTimes != rhs_storage._disconnectTimes {return false} + if _storage._localDisconnectReason != rhs_storage._localDisconnectReason {return false} + if _storage._remoteDisconnectReason != rhs_storage._remoteDisconnectReason {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_NodeInfo.ConfigNodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_NodeInfo.protoMessageName + ".ConfigNodeInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "codeVersion"), + 2: .same(proto: "p2pVersion"), + 3: .same(proto: "listenPort"), + 4: .same(proto: "discoverEnable"), + 5: .same(proto: "activeNodeSize"), + 6: .same(proto: "passiveNodeSize"), + 7: .same(proto: "sendNodeSize"), + 8: .same(proto: "maxConnectCount"), + 9: .same(proto: "sameIpMaxConnectCount"), + 10: .same(proto: "backupListenPort"), + 11: .same(proto: "backupMemberSize"), + 12: .same(proto: "backupPriority"), + 13: .same(proto: "dbVersion"), + 14: .same(proto: "minParticipationRate"), + 15: .same(proto: "supportConstant"), + 16: .same(proto: "minTimeRatio"), + 17: .same(proto: "maxTimeRatio"), + 18: .same(proto: "allowCreationOfContracts"), + 19: .same(proto: "allowAdaptiveEnergy"), + ] + + fileprivate class _StorageClass { + var _codeVersion: String = String() + var _p2PVersion: String = String() + var _listenPort: Int32 = 0 + var _discoverEnable: Bool = false + var _activeNodeSize: Int32 = 0 + var _passiveNodeSize: Int32 = 0 + var _sendNodeSize: Int32 = 0 + var _maxConnectCount: Int32 = 0 + var _sameIpMaxConnectCount: Int32 = 0 + var _backupListenPort: Int32 = 0 + var _backupMemberSize: Int32 = 0 + var _backupPriority: Int32 = 0 + var _dbVersion: Int32 = 0 + var _minParticipationRate: Int32 = 0 + var _supportConstant: Bool = false + var _minTimeRatio: Double = 0 + var _maxTimeRatio: Double = 0 + var _allowCreationOfContracts: Int64 = 0 + var _allowAdaptiveEnergy: Int64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _codeVersion = source._codeVersion + _p2PVersion = source._p2PVersion + _listenPort = source._listenPort + _discoverEnable = source._discoverEnable + _activeNodeSize = source._activeNodeSize + _passiveNodeSize = source._passiveNodeSize + _sendNodeSize = source._sendNodeSize + _maxConnectCount = source._maxConnectCount + _sameIpMaxConnectCount = source._sameIpMaxConnectCount + _backupListenPort = source._backupListenPort + _backupMemberSize = source._backupMemberSize + _backupPriority = source._backupPriority + _dbVersion = source._dbVersion + _minParticipationRate = source._minParticipationRate + _supportConstant = source._supportConstant + _minTimeRatio = source._minTimeRatio + _maxTimeRatio = source._maxTimeRatio + _allowCreationOfContracts = source._allowCreationOfContracts + _allowAdaptiveEnergy = source._allowAdaptiveEnergy + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._codeVersion) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._p2PVersion) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._listenPort) }() + case 4: try { try decoder.decodeSingularBoolField(value: &_storage._discoverEnable) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._activeNodeSize) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._passiveNodeSize) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._sendNodeSize) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._maxConnectCount) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._sameIpMaxConnectCount) }() + case 10: try { try decoder.decodeSingularInt32Field(value: &_storage._backupListenPort) }() + case 11: try { try decoder.decodeSingularInt32Field(value: &_storage._backupMemberSize) }() + case 12: try { try decoder.decodeSingularInt32Field(value: &_storage._backupPriority) }() + case 13: try { try decoder.decodeSingularInt32Field(value: &_storage._dbVersion) }() + case 14: try { try decoder.decodeSingularInt32Field(value: &_storage._minParticipationRate) }() + case 15: try { try decoder.decodeSingularBoolField(value: &_storage._supportConstant) }() + case 16: try { try decoder.decodeSingularDoubleField(value: &_storage._minTimeRatio) }() + case 17: try { try decoder.decodeSingularDoubleField(value: &_storage._maxTimeRatio) }() + case 18: try { try decoder.decodeSingularInt64Field(value: &_storage._allowCreationOfContracts) }() + case 19: try { try decoder.decodeSingularInt64Field(value: &_storage._allowAdaptiveEnergy) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._codeVersion.isEmpty { + try visitor.visitSingularStringField(value: _storage._codeVersion, fieldNumber: 1) + } + if !_storage._p2PVersion.isEmpty { + try visitor.visitSingularStringField(value: _storage._p2PVersion, fieldNumber: 2) + } + if _storage._listenPort != 0 { + try visitor.visitSingularInt32Field(value: _storage._listenPort, fieldNumber: 3) + } + if _storage._discoverEnable != false { + try visitor.visitSingularBoolField(value: _storage._discoverEnable, fieldNumber: 4) + } + if _storage._activeNodeSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._activeNodeSize, fieldNumber: 5) + } + if _storage._passiveNodeSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._passiveNodeSize, fieldNumber: 6) + } + if _storage._sendNodeSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._sendNodeSize, fieldNumber: 7) + } + if _storage._maxConnectCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._maxConnectCount, fieldNumber: 8) + } + if _storage._sameIpMaxConnectCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._sameIpMaxConnectCount, fieldNumber: 9) + } + if _storage._backupListenPort != 0 { + try visitor.visitSingularInt32Field(value: _storage._backupListenPort, fieldNumber: 10) + } + if _storage._backupMemberSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._backupMemberSize, fieldNumber: 11) + } + if _storage._backupPriority != 0 { + try visitor.visitSingularInt32Field(value: _storage._backupPriority, fieldNumber: 12) + } + if _storage._dbVersion != 0 { + try visitor.visitSingularInt32Field(value: _storage._dbVersion, fieldNumber: 13) + } + if _storage._minParticipationRate != 0 { + try visitor.visitSingularInt32Field(value: _storage._minParticipationRate, fieldNumber: 14) + } + if _storage._supportConstant != false { + try visitor.visitSingularBoolField(value: _storage._supportConstant, fieldNumber: 15) + } + if _storage._minTimeRatio.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: _storage._minTimeRatio, fieldNumber: 16) + } + if _storage._maxTimeRatio.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: _storage._maxTimeRatio, fieldNumber: 17) + } + if _storage._allowCreationOfContracts != 0 { + try visitor.visitSingularInt64Field(value: _storage._allowCreationOfContracts, fieldNumber: 18) + } + if _storage._allowAdaptiveEnergy != 0 { + try visitor.visitSingularInt64Field(value: _storage._allowAdaptiveEnergy, fieldNumber: 19) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_NodeInfo.ConfigNodeInfo, rhs: Protocol_NodeInfo.ConfigNodeInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._codeVersion != rhs_storage._codeVersion {return false} + if _storage._p2PVersion != rhs_storage._p2PVersion {return false} + if _storage._listenPort != rhs_storage._listenPort {return false} + if _storage._discoverEnable != rhs_storage._discoverEnable {return false} + if _storage._activeNodeSize != rhs_storage._activeNodeSize {return false} + if _storage._passiveNodeSize != rhs_storage._passiveNodeSize {return false} + if _storage._sendNodeSize != rhs_storage._sendNodeSize {return false} + if _storage._maxConnectCount != rhs_storage._maxConnectCount {return false} + if _storage._sameIpMaxConnectCount != rhs_storage._sameIpMaxConnectCount {return false} + if _storage._backupListenPort != rhs_storage._backupListenPort {return false} + if _storage._backupMemberSize != rhs_storage._backupMemberSize {return false} + if _storage._backupPriority != rhs_storage._backupPriority {return false} + if _storage._dbVersion != rhs_storage._dbVersion {return false} + if _storage._minParticipationRate != rhs_storage._minParticipationRate {return false} + if _storage._supportConstant != rhs_storage._supportConstant {return false} + if _storage._minTimeRatio != rhs_storage._minTimeRatio {return false} + if _storage._maxTimeRatio != rhs_storage._maxTimeRatio {return false} + if _storage._allowCreationOfContracts != rhs_storage._allowCreationOfContracts {return false} + if _storage._allowAdaptiveEnergy != rhs_storage._allowAdaptiveEnergy {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_NodeInfo.MachineInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_NodeInfo.protoMessageName + ".MachineInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "threadCount"), + 2: .same(proto: "deadLockThreadCount"), + 3: .same(proto: "cpuCount"), + 4: .same(proto: "totalMemory"), + 5: .same(proto: "freeMemory"), + 6: .same(proto: "cpuRate"), + 7: .same(proto: "javaVersion"), + 8: .same(proto: "osName"), + 9: .same(proto: "jvmTotalMemory"), + 10: .same(proto: "jvmFreeMemory"), + 11: .same(proto: "processCpuRate"), + 12: .same(proto: "memoryDescInfoList"), + 13: .same(proto: "deadLockThreadInfoList"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.threadCount) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.deadLockThreadCount) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.cpuCount) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.totalMemory) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.freeMemory) }() + case 6: try { try decoder.decodeSingularDoubleField(value: &self.cpuRate) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.javaVersion) }() + case 8: try { try decoder.decodeSingularStringField(value: &self.osName) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &self.jvmTotalMemory) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &self.jvmFreeMemory) }() + case 11: try { try decoder.decodeSingularDoubleField(value: &self.processCpuRate) }() + case 12: try { try decoder.decodeRepeatedMessageField(value: &self.memoryDescInfoList) }() + case 13: try { try decoder.decodeRepeatedMessageField(value: &self.deadLockThreadInfoList) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.threadCount != 0 { + try visitor.visitSingularInt32Field(value: self.threadCount, fieldNumber: 1) + } + if self.deadLockThreadCount != 0 { + try visitor.visitSingularInt32Field(value: self.deadLockThreadCount, fieldNumber: 2) + } + if self.cpuCount != 0 { + try visitor.visitSingularInt32Field(value: self.cpuCount, fieldNumber: 3) + } + if self.totalMemory != 0 { + try visitor.visitSingularInt64Field(value: self.totalMemory, fieldNumber: 4) + } + if self.freeMemory != 0 { + try visitor.visitSingularInt64Field(value: self.freeMemory, fieldNumber: 5) + } + if self.cpuRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.cpuRate, fieldNumber: 6) + } + if !self.javaVersion.isEmpty { + try visitor.visitSingularStringField(value: self.javaVersion, fieldNumber: 7) + } + if !self.osName.isEmpty { + try visitor.visitSingularStringField(value: self.osName, fieldNumber: 8) + } + if self.jvmTotalMemory != 0 { + try visitor.visitSingularInt64Field(value: self.jvmTotalMemory, fieldNumber: 9) + } + if self.jvmFreeMemory != 0 { + try visitor.visitSingularInt64Field(value: self.jvmFreeMemory, fieldNumber: 10) + } + if self.processCpuRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.processCpuRate, fieldNumber: 11) + } + if !self.memoryDescInfoList.isEmpty { + try visitor.visitRepeatedMessageField(value: self.memoryDescInfoList, fieldNumber: 12) + } + if !self.deadLockThreadInfoList.isEmpty { + try visitor.visitRepeatedMessageField(value: self.deadLockThreadInfoList, fieldNumber: 13) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_NodeInfo.MachineInfo, rhs: Protocol_NodeInfo.MachineInfo) -> Bool { + if lhs.threadCount != rhs.threadCount {return false} + if lhs.deadLockThreadCount != rhs.deadLockThreadCount {return false} + if lhs.cpuCount != rhs.cpuCount {return false} + if lhs.totalMemory != rhs.totalMemory {return false} + if lhs.freeMemory != rhs.freeMemory {return false} + if lhs.cpuRate != rhs.cpuRate {return false} + if lhs.javaVersion != rhs.javaVersion {return false} + if lhs.osName != rhs.osName {return false} + if lhs.jvmTotalMemory != rhs.jvmTotalMemory {return false} + if lhs.jvmFreeMemory != rhs.jvmFreeMemory {return false} + if lhs.processCpuRate != rhs.processCpuRate {return false} + if lhs.memoryDescInfoList != rhs.memoryDescInfoList {return false} + if lhs.deadLockThreadInfoList != rhs.deadLockThreadInfoList {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_NodeInfo.MachineInfo.MemoryDescInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_NodeInfo.MachineInfo.protoMessageName + ".MemoryDescInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "initSize"), + 3: .same(proto: "useSize"), + 4: .same(proto: "maxSize"), + 5: .same(proto: "useRate"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.initSize) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.useSize) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.maxSize) }() + case 5: try { try decoder.decodeSingularDoubleField(value: &self.useRate) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if self.initSize != 0 { + try visitor.visitSingularInt64Field(value: self.initSize, fieldNumber: 2) + } + if self.useSize != 0 { + try visitor.visitSingularInt64Field(value: self.useSize, fieldNumber: 3) + } + if self.maxSize != 0 { + try visitor.visitSingularInt64Field(value: self.maxSize, fieldNumber: 4) + } + if self.useRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.useRate, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_NodeInfo.MachineInfo.MemoryDescInfo, rhs: Protocol_NodeInfo.MachineInfo.MemoryDescInfo) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.initSize != rhs.initSize {return false} + if lhs.useSize != rhs.useSize {return false} + if lhs.maxSize != rhs.maxSize {return false} + if lhs.useRate != rhs.useRate {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_NodeInfo.MachineInfo.DeadLockThreadInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_NodeInfo.MachineInfo.protoMessageName + ".DeadLockThreadInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "lockName"), + 3: .same(proto: "lockOwner"), + 4: .same(proto: "state"), + 5: .same(proto: "blockTime"), + 6: .same(proto: "waitTime"), + 7: .same(proto: "stackTrace"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.lockName) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.lockOwner) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.state) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.blockTime) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.waitTime) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.stackTrace) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.lockName.isEmpty { + try visitor.visitSingularStringField(value: self.lockName, fieldNumber: 2) + } + if !self.lockOwner.isEmpty { + try visitor.visitSingularStringField(value: self.lockOwner, fieldNumber: 3) + } + if !self.state.isEmpty { + try visitor.visitSingularStringField(value: self.state, fieldNumber: 4) + } + if self.blockTime != 0 { + try visitor.visitSingularInt64Field(value: self.blockTime, fieldNumber: 5) + } + if self.waitTime != 0 { + try visitor.visitSingularInt64Field(value: self.waitTime, fieldNumber: 6) + } + if !self.stackTrace.isEmpty { + try visitor.visitSingularStringField(value: self.stackTrace, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_NodeInfo.MachineInfo.DeadLockThreadInfo, rhs: Protocol_NodeInfo.MachineInfo.DeadLockThreadInfo) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.lockName != rhs.lockName {return false} + if lhs.lockOwner != rhs.lockOwner {return false} + if lhs.state != rhs.state {return false} + if lhs.blockTime != rhs.blockTime {return false} + if lhs.waitTime != rhs.waitTime {return false} + if lhs.stackTrace != rhs.stackTrace {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MetricsInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MetricsInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "interval"), + 2: .same(proto: "node"), + 3: .same(proto: "blockchain"), + 4: .same(proto: "net"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.interval) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._node) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._blockchain) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._net) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.interval != 0 { + try visitor.visitSingularInt64Field(value: self.interval, fieldNumber: 1) + } + try { if let v = self._node { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._blockchain { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._net { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MetricsInfo, rhs: Protocol_MetricsInfo) -> Bool { + if lhs.interval != rhs.interval {return false} + if lhs._node != rhs._node {return false} + if lhs._blockchain != rhs._blockchain {return false} + if lhs._net != rhs._net {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MetricsInfo.NodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.protoMessageName + ".NodeInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "ip"), + 2: .same(proto: "nodeType"), + 3: .same(proto: "version"), + 4: .same(proto: "backupStatus"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.ip) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.nodeType) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.version) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self.backupStatus) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ip.isEmpty { + try visitor.visitSingularStringField(value: self.ip, fieldNumber: 1) + } + if self.nodeType != 0 { + try visitor.visitSingularInt32Field(value: self.nodeType, fieldNumber: 2) + } + if !self.version.isEmpty { + try visitor.visitSingularStringField(value: self.version, fieldNumber: 3) + } + if self.backupStatus != 0 { + try visitor.visitSingularInt32Field(value: self.backupStatus, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MetricsInfo.NodeInfo, rhs: Protocol_MetricsInfo.NodeInfo) -> Bool { + if lhs.ip != rhs.ip {return false} + if lhs.nodeType != rhs.nodeType {return false} + if lhs.version != rhs.version {return false} + if lhs.backupStatus != rhs.backupStatus {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MetricsInfo.BlockChainInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.protoMessageName + ".BlockChainInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "headBlockNum"), + 2: .same(proto: "headBlockTimestamp"), + 3: .same(proto: "headBlockHash"), + 4: .same(proto: "forkCount"), + 5: .same(proto: "failForkCount"), + 6: .same(proto: "blockProcessTime"), + 7: .same(proto: "tps"), + 8: .same(proto: "transactionCacheSize"), + 9: .same(proto: "missedTransaction"), + 10: .same(proto: "witnesses"), + 11: .same(proto: "failProcessBlockNum"), + 12: .same(proto: "failProcessBlockReason"), + 13: .same(proto: "dupWitness"), + ] + + fileprivate class _StorageClass { + var _headBlockNum: Int64 = 0 + var _headBlockTimestamp: Int64 = 0 + var _headBlockHash: String = String() + var _forkCount: Int32 = 0 + var _failForkCount: Int32 = 0 + var _blockProcessTime: Protocol_MetricsInfo.RateInfo? = nil + var _tps: Protocol_MetricsInfo.RateInfo? = nil + var _transactionCacheSize: Int32 = 0 + var _missedTransaction: Protocol_MetricsInfo.RateInfo? = nil + var _witnesses: [Protocol_MetricsInfo.BlockChainInfo.Witness] = [] + var _failProcessBlockNum: Int64 = 0 + var _failProcessBlockReason: String = String() + var _dupWitness: [Protocol_MetricsInfo.BlockChainInfo.DupWitness] = [] + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _headBlockNum = source._headBlockNum + _headBlockTimestamp = source._headBlockTimestamp + _headBlockHash = source._headBlockHash + _forkCount = source._forkCount + _failForkCount = source._failForkCount + _blockProcessTime = source._blockProcessTime + _tps = source._tps + _transactionCacheSize = source._transactionCacheSize + _missedTransaction = source._missedTransaction + _witnesses = source._witnesses + _failProcessBlockNum = source._failProcessBlockNum + _failProcessBlockReason = source._failProcessBlockReason + _dupWitness = source._dupWitness + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } -// MARK: - Code below here is support for the SwiftProtobuf runtime. + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &_storage._headBlockNum) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._headBlockTimestamp) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._headBlockHash) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._forkCount) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._failForkCount) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._blockProcessTime) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._tps) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._transactionCacheSize) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._missedTransaction) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &_storage._witnesses) }() + case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._failProcessBlockNum) }() + case 12: try { try decoder.decodeSingularStringField(value: &_storage._failProcessBlockReason) }() + case 13: try { try decoder.decodeRepeatedMessageField(value: &_storage._dupWitness) }() + default: break + } + } + } + } -fileprivate let _protobuf_package = "protocol" + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._headBlockNum != 0 { + try visitor.visitSingularInt64Field(value: _storage._headBlockNum, fieldNumber: 1) + } + if _storage._headBlockTimestamp != 0 { + try visitor.visitSingularInt64Field(value: _storage._headBlockTimestamp, fieldNumber: 2) + } + if !_storage._headBlockHash.isEmpty { + try visitor.visitSingularStringField(value: _storage._headBlockHash, fieldNumber: 3) + } + if _storage._forkCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._forkCount, fieldNumber: 4) + } + if _storage._failForkCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._failForkCount, fieldNumber: 5) + } + try { if let v = _storage._blockProcessTime { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._tps { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + if _storage._transactionCacheSize != 0 { + try visitor.visitSingularInt32Field(value: _storage._transactionCacheSize, fieldNumber: 8) + } + try { if let v = _storage._missedTransaction { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !_storage._witnesses.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._witnesses, fieldNumber: 10) + } + if _storage._failProcessBlockNum != 0 { + try visitor.visitSingularInt64Field(value: _storage._failProcessBlockNum, fieldNumber: 11) + } + if !_storage._failProcessBlockReason.isEmpty { + try visitor.visitSingularStringField(value: _storage._failProcessBlockReason, fieldNumber: 12) + } + if !_storage._dupWitness.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._dupWitness, fieldNumber: 13) + } + } + try unknownFields.traverse(visitor: &visitor) + } -extension Protocol_AccountType: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "Normal"), - 1: .same(proto: "AssetIssue"), - 2: .same(proto: "Contract"), - ] + static func ==(lhs: Protocol_MetricsInfo.BlockChainInfo, rhs: Protocol_MetricsInfo.BlockChainInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._headBlockNum != rhs_storage._headBlockNum {return false} + if _storage._headBlockTimestamp != rhs_storage._headBlockTimestamp {return false} + if _storage._headBlockHash != rhs_storage._headBlockHash {return false} + if _storage._forkCount != rhs_storage._forkCount {return false} + if _storage._failForkCount != rhs_storage._failForkCount {return false} + if _storage._blockProcessTime != rhs_storage._blockProcessTime {return false} + if _storage._tps != rhs_storage._tps {return false} + if _storage._transactionCacheSize != rhs_storage._transactionCacheSize {return false} + if _storage._missedTransaction != rhs_storage._missedTransaction {return false} + if _storage._witnesses != rhs_storage._witnesses {return false} + if _storage._failProcessBlockNum != rhs_storage._failProcessBlockNum {return false} + if _storage._failProcessBlockReason != rhs_storage._failProcessBlockReason {return false} + if _storage._dupWitness != rhs_storage._dupWitness {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } } -extension Protocol_AccountId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".AccountId" +extension Protocol_MetricsInfo.BlockChainInfo.Witness: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.BlockChainInfo.protoMessageName + ".Witness" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "address"), + 1: .same(proto: "address"), + 2: .same(proto: "version"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -661,36 +7921,37 @@ extension Protocol_AccountId: SwiftProtobuf.Message, SwiftProtobuf._MessageImple // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.name) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 1: try { try decoder.decodeSingularStringField(value: &self.address) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.version) }() default: break } } } func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularBytesField(value: self.name, fieldNumber: 1) - } if !self.address.isEmpty { - try visitor.visitSingularBytesField(value: self.address, fieldNumber: 2) + try visitor.visitSingularStringField(value: self.address, fieldNumber: 1) + } + if self.version != 0 { + try visitor.visitSingularInt32Field(value: self.version, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_AccountId, rhs: Protocol_AccountId) -> Bool { - if lhs.name != rhs.name {return false} + static func ==(lhs: Protocol_MetricsInfo.BlockChainInfo.Witness, rhs: Protocol_MetricsInfo.BlockChainInfo.Witness) -> Bool { if lhs.address != rhs.address {return false} + if lhs.version != rhs.version {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_authority: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".authority" +extension Protocol_MetricsInfo.BlockChainInfo.DupWitness: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.BlockChainInfo.protoMessageName + ".DupWitness" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "account"), - 2: .standard(proto: "permission_name"), + 1: .same(proto: "address"), + 2: .same(proto: "blockNum"), + 3: .same(proto: "count"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -699,42 +7960,44 @@ extension Protocol_authority: SwiftProtobuf.Message, SwiftProtobuf._MessageImple // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._account) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.permissionName) }() + case 1: try { try decoder.decodeSingularStringField(value: &self.address) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.blockNum) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.count) }() default: break } } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._account { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.permissionName.isEmpty { - try visitor.visitSingularBytesField(value: self.permissionName, fieldNumber: 2) + if !self.address.isEmpty { + try visitor.visitSingularStringField(value: self.address, fieldNumber: 1) + } + if self.blockNum != 0 { + try visitor.visitSingularInt64Field(value: self.blockNum, fieldNumber: 2) + } + if self.count != 0 { + try visitor.visitSingularInt32Field(value: self.count, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_authority, rhs: Protocol_authority) -> Bool { - if lhs._account != rhs._account {return false} - if lhs.permissionName != rhs.permissionName {return false} + static func ==(lhs: Protocol_MetricsInfo.BlockChainInfo.DupWitness, rhs: Protocol_MetricsInfo.BlockChainInfo.DupWitness) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.blockNum != rhs.blockNum {return false} + if lhs.count != rhs.count {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_MarketOrderDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".MarketOrderDetail" +extension Protocol_MetricsInfo.RateInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.protoMessageName + ".RateInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "makerOrderId"), - 2: .same(proto: "takerOrderId"), - 3: .same(proto: "fillSellQuantity"), - 4: .same(proto: "fillBuyQuantity"), + 1: .same(proto: "count"), + 2: .same(proto: "meanRate"), + 3: .same(proto: "oneMinuteRate"), + 4: .same(proto: "fiveMinuteRate"), + 5: .same(proto: "fifteenMinuteRate"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -743,47 +8006,209 @@ extension Protocol_MarketOrderDetail: SwiftProtobuf.Message, SwiftProtobuf._Mess // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.makerOrderID) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.takerOrderID) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.fillSellQuantity) }() - case 4: try { try decoder.decodeSingularInt64Field(value: &self.fillBuyQuantity) }() + case 1: try { try decoder.decodeSingularInt64Field(value: &self.count) }() + case 2: try { try decoder.decodeSingularDoubleField(value: &self.meanRate) }() + case 3: try { try decoder.decodeSingularDoubleField(value: &self.oneMinuteRate) }() + case 4: try { try decoder.decodeSingularDoubleField(value: &self.fiveMinuteRate) }() + case 5: try { try decoder.decodeSingularDoubleField(value: &self.fifteenMinuteRate) }() default: break } } } func traverse(visitor: inout V) throws { - if !self.makerOrderID.isEmpty { - try visitor.visitSingularBytesField(value: self.makerOrderID, fieldNumber: 1) + if self.count != 0 { + try visitor.visitSingularInt64Field(value: self.count, fieldNumber: 1) } - if !self.takerOrderID.isEmpty { - try visitor.visitSingularBytesField(value: self.takerOrderID, fieldNumber: 2) + if self.meanRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.meanRate, fieldNumber: 2) } - if self.fillSellQuantity != 0 { - try visitor.visitSingularInt64Field(value: self.fillSellQuantity, fieldNumber: 3) + if self.oneMinuteRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.oneMinuteRate, fieldNumber: 3) } - if self.fillBuyQuantity != 0 { - try visitor.visitSingularInt64Field(value: self.fillBuyQuantity, fieldNumber: 4) + if self.fiveMinuteRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.fiveMinuteRate, fieldNumber: 4) + } + if self.fifteenMinuteRate.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.fifteenMinuteRate, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_MarketOrderDetail, rhs: Protocol_MarketOrderDetail) -> Bool { - if lhs.makerOrderID != rhs.makerOrderID {return false} - if lhs.takerOrderID != rhs.takerOrderID {return false} - if lhs.fillSellQuantity != rhs.fillSellQuantity {return false} - if lhs.fillBuyQuantity != rhs.fillBuyQuantity {return false} + static func ==(lhs: Protocol_MetricsInfo.RateInfo, rhs: Protocol_MetricsInfo.RateInfo) -> Bool { + if lhs.count != rhs.count {return false} + if lhs.meanRate != rhs.meanRate {return false} + if lhs.oneMinuteRate != rhs.oneMinuteRate {return false} + if lhs.fiveMinuteRate != rhs.fiveMinuteRate {return false} + if lhs.fifteenMinuteRate != rhs.fifteenMinuteRate {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_Transaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Transaction" +extension Protocol_MetricsInfo.NetInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.protoMessageName + ".NetInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "raw_data"), - 2: .same(proto: "signature"), - 5: .same(proto: "ret"), + 1: .same(proto: "errorProtoCount"), + 2: .same(proto: "api"), + 3: .same(proto: "connectionCount"), + 4: .same(proto: "validConnectionCount"), + 5: .same(proto: "tcpInTraffic"), + 6: .same(proto: "tcpOutTraffic"), + 7: .same(proto: "disconnectionCount"), + 8: .same(proto: "disconnectionDetail"), + 9: .same(proto: "udpInTraffic"), + 10: .same(proto: "udpOutTraffic"), + 11: .same(proto: "latency"), + ] + + fileprivate class _StorageClass { + var _errorProtoCount: Int32 = 0 + var _api: Protocol_MetricsInfo.NetInfo.ApiInfo? = nil + var _connectionCount: Int32 = 0 + var _validConnectionCount: Int32 = 0 + var _tcpInTraffic: Protocol_MetricsInfo.RateInfo? = nil + var _tcpOutTraffic: Protocol_MetricsInfo.RateInfo? = nil + var _disconnectionCount: Int32 = 0 + var _disconnectionDetail: [Protocol_MetricsInfo.NetInfo.DisconnectionDetailInfo] = [] + var _udpInTraffic: Protocol_MetricsInfo.RateInfo? = nil + var _udpOutTraffic: Protocol_MetricsInfo.RateInfo? = nil + var _latency: Protocol_MetricsInfo.NetInfo.LatencyInfo? = nil + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _errorProtoCount = source._errorProtoCount + _api = source._api + _connectionCount = source._connectionCount + _validConnectionCount = source._validConnectionCount + _tcpInTraffic = source._tcpInTraffic + _tcpOutTraffic = source._tcpOutTraffic + _disconnectionCount = source._disconnectionCount + _disconnectionDetail = source._disconnectionDetail + _udpInTraffic = source._udpInTraffic + _udpOutTraffic = source._udpOutTraffic + _latency = source._latency + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._errorProtoCount) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._api) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._connectionCount) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._validConnectionCount) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._tcpInTraffic) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._tcpOutTraffic) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._disconnectionCount) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &_storage._disconnectionDetail) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._udpInTraffic) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._udpOutTraffic) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._latency) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._errorProtoCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._errorProtoCount, fieldNumber: 1) + } + try { if let v = _storage._api { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if _storage._connectionCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._connectionCount, fieldNumber: 3) + } + if _storage._validConnectionCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._validConnectionCount, fieldNumber: 4) + } + try { if let v = _storage._tcpInTraffic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._tcpOutTraffic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + if _storage._disconnectionCount != 0 { + try visitor.visitSingularInt32Field(value: _storage._disconnectionCount, fieldNumber: 7) + } + if !_storage._disconnectionDetail.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._disconnectionDetail, fieldNumber: 8) + } + try { if let v = _storage._udpInTraffic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._udpOutTraffic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._latency { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MetricsInfo.NetInfo, rhs: Protocol_MetricsInfo.NetInfo) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._errorProtoCount != rhs_storage._errorProtoCount {return false} + if _storage._api != rhs_storage._api {return false} + if _storage._connectionCount != rhs_storage._connectionCount {return false} + if _storage._validConnectionCount != rhs_storage._validConnectionCount {return false} + if _storage._tcpInTraffic != rhs_storage._tcpInTraffic {return false} + if _storage._tcpOutTraffic != rhs_storage._tcpOutTraffic {return false} + if _storage._disconnectionCount != rhs_storage._disconnectionCount {return false} + if _storage._disconnectionDetail != rhs_storage._disconnectionDetail {return false} + if _storage._udpInTraffic != rhs_storage._udpInTraffic {return false} + if _storage._udpOutTraffic != rhs_storage._udpOutTraffic {return false} + if _storage._latency != rhs_storage._latency {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MetricsInfo.NetInfo.ApiInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.NetInfo.protoMessageName + ".ApiInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "qps"), + 2: .same(proto: "failQps"), + 3: .same(proto: "outTraffic"), + 4: .same(proto: "detail"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -792,9 +8217,10 @@ extension Protocol_Transaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImp // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rawData) }() - case 2: try { try decoder.decodeRepeatedBytesField(value: &self.signature) }() - case 5: try { try decoder.decodeRepeatedMessageField(value: &self.ret) }() + case 1: try { try decoder.decodeSingularMessageField(value: &self._qps) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._failQps) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._outTraffic) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.detail) }() default: break } } @@ -805,35 +8231,38 @@ extension Protocol_Transaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImp // allocates stack space for every if/case branch local when no optimizations // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rawData { + try { if let v = self._qps { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - if !self.signature.isEmpty { - try visitor.visitRepeatedBytesField(value: self.signature, fieldNumber: 2) - } - if !self.ret.isEmpty { - try visitor.visitRepeatedMessageField(value: self.ret, fieldNumber: 5) + try { if let v = self._failQps { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._outTraffic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.detail.isEmpty { + try visitor.visitRepeatedMessageField(value: self.detail, fieldNumber: 4) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_Transaction, rhs: Protocol_Transaction) -> Bool { - if lhs._rawData != rhs._rawData {return false} - if lhs.signature != rhs.signature {return false} - if lhs.ret != rhs.ret {return false} + static func ==(lhs: Protocol_MetricsInfo.NetInfo.ApiInfo, rhs: Protocol_MetricsInfo.NetInfo.ApiInfo) -> Bool { + if lhs._qps != rhs._qps {return false} + if lhs._failQps != rhs._failQps {return false} + if lhs._outTraffic != rhs._outTraffic {return false} + if lhs.detail != rhs.detail {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_Transaction.Contract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Protocol_Transaction.protoMessageName + ".Contract" +extension Protocol_MetricsInfo.NetInfo.ApiInfo.ApiDetailInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.NetInfo.ApiInfo.protoMessageName + ".ApiDetailInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "parameter"), - 3: .same(proto: "provider"), - 4: .same(proto: "ContractName"), - 5: .standard(proto: "Permission_id"), + 1: .same(proto: "name"), + 2: .same(proto: "qps"), + 3: .same(proto: "failQps"), + 4: .same(proto: "outTraffic"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -842,11 +8271,10 @@ extension Protocol_Transaction.Contract: SwiftProtobuf.Message, SwiftProtobuf._M // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._parameter) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.provider) }() - case 4: try { try decoder.decodeSingularBytesField(value: &self.contractName) }() - case 5: try { try decoder.decodeSingularInt32Field(value: &self.permissionID) }() + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._qps) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._failQps) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._outTraffic) }() default: break } } @@ -857,91 +8285,80 @@ extension Protocol_Transaction.Contract: SwiftProtobuf.Message, SwiftProtobuf._M // allocates stack space for every if/case branch local when no optimizations // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and // https://github.com/apple/swift-protobuf/issues/1182 - if self.type != .accountCreateContract { - try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) } - try { if let v = self._parameter { + try { if let v = self._qps { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() - if !self.provider.isEmpty { - try visitor.visitSingularBytesField(value: self.provider, fieldNumber: 3) - } - if !self.contractName.isEmpty { - try visitor.visitSingularBytesField(value: self.contractName, fieldNumber: 4) - } - if self.permissionID != 0 { - try visitor.visitSingularInt32Field(value: self.permissionID, fieldNumber: 5) - } + try { if let v = self._failQps { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._outTraffic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_Transaction.Contract, rhs: Protocol_Transaction.Contract) -> Bool { - if lhs.type != rhs.type {return false} - if lhs._parameter != rhs._parameter {return false} - if lhs.provider != rhs.provider {return false} - if lhs.contractName != rhs.contractName {return false} - if lhs.permissionID != rhs.permissionID {return false} + static func ==(lhs: Protocol_MetricsInfo.NetInfo.ApiInfo.ApiDetailInfo, rhs: Protocol_MetricsInfo.NetInfo.ApiInfo.ApiDetailInfo) -> Bool { + if lhs.name != rhs.name {return false} + if lhs._qps != rhs._qps {return false} + if lhs._failQps != rhs._failQps {return false} + if lhs._outTraffic != rhs._outTraffic {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_Transaction.Contract.ContractType: SwiftProtobuf._ProtoNameProviding { +extension Protocol_MetricsInfo.NetInfo.DisconnectionDetailInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.NetInfo.protoMessageName + ".DisconnectionDetailInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "AccountCreateContract"), - 1: .same(proto: "TransferContract"), - 2: .same(proto: "TransferAssetContract"), - 3: .same(proto: "VoteAssetContract"), - 4: .same(proto: "VoteWitnessContract"), - 5: .same(proto: "WitnessCreateContract"), - 6: .same(proto: "AssetIssueContract"), - 8: .same(proto: "WitnessUpdateContract"), - 9: .same(proto: "ParticipateAssetIssueContract"), - 10: .same(proto: "AccountUpdateContract"), - 11: .same(proto: "FreezeBalanceContract"), - 12: .same(proto: "UnfreezeBalanceContract"), - 13: .same(proto: "WithdrawBalanceContract"), - 14: .same(proto: "UnfreezeAssetContract"), - 15: .same(proto: "UpdateAssetContract"), - 16: .same(proto: "ProposalCreateContract"), - 17: .same(proto: "ProposalApproveContract"), - 18: .same(proto: "ProposalDeleteContract"), - 19: .same(proto: "SetAccountIdContract"), - 20: .same(proto: "CustomContract"), - 30: .same(proto: "CreateSmartContract"), - 31: .same(proto: "TriggerSmartContract"), - 32: .same(proto: "GetContract"), - 33: .same(proto: "UpdateSettingContract"), - 41: .same(proto: "ExchangeCreateContract"), - 42: .same(proto: "ExchangeInjectContract"), - 43: .same(proto: "ExchangeWithdrawContract"), - 44: .same(proto: "ExchangeTransactionContract"), - 45: .same(proto: "UpdateEnergyLimitContract"), - 46: .same(proto: "AccountPermissionUpdateContract"), - 48: .same(proto: "ClearABIContract"), - 49: .same(proto: "UpdateBrokerageContract"), - 51: .same(proto: "ShieldedTransferContract"), - 52: .same(proto: "MarketSellAssetContract"), - 53: .same(proto: "MarketCancelOrderContract"), + 1: .same(proto: "reason"), + 2: .same(proto: "count"), ] -} -extension Protocol_Transaction.Result: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Protocol_Transaction.protoMessageName + ".Result" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "fee"), - 2: .same(proto: "ret"), - 3: .same(proto: "contractRet"), - 14: .same(proto: "assetIssueID"), - 15: .standard(proto: "withdraw_amount"), - 16: .standard(proto: "unfreeze_amount"), - 18: .standard(proto: "exchange_received_amount"), - 19: .standard(proto: "exchange_inject_another_amount"), - 20: .standard(proto: "exchange_withdraw_another_amount"), - 21: .standard(proto: "exchange_id"), - 22: .standard(proto: "shielded_transaction_fee"), - 25: .same(proto: "orderId"), - 26: .same(proto: "orderDetails"), + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.reason) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.count) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.reason.isEmpty { + try visitor.visitSingularStringField(value: self.reason, fieldNumber: 1) + } + if self.count != 0 { + try visitor.visitSingularInt32Field(value: self.count, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MetricsInfo.NetInfo.DisconnectionDetailInfo, rhs: Protocol_MetricsInfo.NetInfo.DisconnectionDetailInfo) -> Bool { + if lhs.reason != rhs.reason {return false} + if lhs.count != rhs.count {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MetricsInfo.NetInfo.LatencyInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.NetInfo.protoMessageName + ".LatencyInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "top99"), + 2: .same(proto: "top95"), + 3: .same(proto: "top75"), + 4: .same(proto: "totalCount"), + 5: .same(proto: "delay1S"), + 6: .same(proto: "delay2S"), + 7: .same(proto: "delay3S"), + 8: .same(proto: "detail"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -950,127 +8367,72 @@ extension Protocol_Transaction.Result: SwiftProtobuf.Message, SwiftProtobuf._Mes // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.fee) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.ret) }() - case 3: try { try decoder.decodeSingularEnumField(value: &self.contractRet) }() - case 14: try { try decoder.decodeSingularStringField(value: &self.assetIssueID) }() - case 15: try { try decoder.decodeSingularInt64Field(value: &self.withdrawAmount) }() - case 16: try { try decoder.decodeSingularInt64Field(value: &self.unfreezeAmount) }() - case 18: try { try decoder.decodeSingularInt64Field(value: &self.exchangeReceivedAmount) }() - case 19: try { try decoder.decodeSingularInt64Field(value: &self.exchangeInjectAnotherAmount) }() - case 20: try { try decoder.decodeSingularInt64Field(value: &self.exchangeWithdrawAnotherAmount) }() - case 21: try { try decoder.decodeSingularInt64Field(value: &self.exchangeID) }() - case 22: try { try decoder.decodeSingularInt64Field(value: &self.shieldedTransactionFee) }() - case 25: try { try decoder.decodeSingularBytesField(value: &self.orderID) }() - case 26: try { try decoder.decodeRepeatedMessageField(value: &self.orderDetails) }() + case 1: try { try decoder.decodeSingularInt32Field(value: &self.top99) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.top95) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.top75) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self.totalCount) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self.delay1S) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &self.delay2S) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self.delay3S) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &self.detail) }() default: break } } } func traverse(visitor: inout V) throws { - if self.fee != 0 { - try visitor.visitSingularInt64Field(value: self.fee, fieldNumber: 1) - } - if self.ret != .sucess { - try visitor.visitSingularEnumField(value: self.ret, fieldNumber: 2) - } - if self.contractRet != .default { - try visitor.visitSingularEnumField(value: self.contractRet, fieldNumber: 3) - } - if !self.assetIssueID.isEmpty { - try visitor.visitSingularStringField(value: self.assetIssueID, fieldNumber: 14) - } - if self.withdrawAmount != 0 { - try visitor.visitSingularInt64Field(value: self.withdrawAmount, fieldNumber: 15) - } - if self.unfreezeAmount != 0 { - try visitor.visitSingularInt64Field(value: self.unfreezeAmount, fieldNumber: 16) + if self.top99 != 0 { + try visitor.visitSingularInt32Field(value: self.top99, fieldNumber: 1) } - if self.exchangeReceivedAmount != 0 { - try visitor.visitSingularInt64Field(value: self.exchangeReceivedAmount, fieldNumber: 18) + if self.top95 != 0 { + try visitor.visitSingularInt32Field(value: self.top95, fieldNumber: 2) } - if self.exchangeInjectAnotherAmount != 0 { - try visitor.visitSingularInt64Field(value: self.exchangeInjectAnotherAmount, fieldNumber: 19) + if self.top75 != 0 { + try visitor.visitSingularInt32Field(value: self.top75, fieldNumber: 3) } - if self.exchangeWithdrawAnotherAmount != 0 { - try visitor.visitSingularInt64Field(value: self.exchangeWithdrawAnotherAmount, fieldNumber: 20) + if self.totalCount != 0 { + try visitor.visitSingularInt32Field(value: self.totalCount, fieldNumber: 4) } - if self.exchangeID != 0 { - try visitor.visitSingularInt64Field(value: self.exchangeID, fieldNumber: 21) + if self.delay1S != 0 { + try visitor.visitSingularInt32Field(value: self.delay1S, fieldNumber: 5) } - if self.shieldedTransactionFee != 0 { - try visitor.visitSingularInt64Field(value: self.shieldedTransactionFee, fieldNumber: 22) + if self.delay2S != 0 { + try visitor.visitSingularInt32Field(value: self.delay2S, fieldNumber: 6) } - if !self.orderID.isEmpty { - try visitor.visitSingularBytesField(value: self.orderID, fieldNumber: 25) + if self.delay3S != 0 { + try visitor.visitSingularInt32Field(value: self.delay3S, fieldNumber: 7) } - if !self.orderDetails.isEmpty { - try visitor.visitRepeatedMessageField(value: self.orderDetails, fieldNumber: 26) + if !self.detail.isEmpty { + try visitor.visitRepeatedMessageField(value: self.detail, fieldNumber: 8) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_Transaction.Result, rhs: Protocol_Transaction.Result) -> Bool { - if lhs.fee != rhs.fee {return false} - if lhs.ret != rhs.ret {return false} - if lhs.contractRet != rhs.contractRet {return false} - if lhs.assetIssueID != rhs.assetIssueID {return false} - if lhs.withdrawAmount != rhs.withdrawAmount {return false} - if lhs.unfreezeAmount != rhs.unfreezeAmount {return false} - if lhs.exchangeReceivedAmount != rhs.exchangeReceivedAmount {return false} - if lhs.exchangeInjectAnotherAmount != rhs.exchangeInjectAnotherAmount {return false} - if lhs.exchangeWithdrawAnotherAmount != rhs.exchangeWithdrawAnotherAmount {return false} - if lhs.exchangeID != rhs.exchangeID {return false} - if lhs.shieldedTransactionFee != rhs.shieldedTransactionFee {return false} - if lhs.orderID != rhs.orderID {return false} - if lhs.orderDetails != rhs.orderDetails {return false} + static func ==(lhs: Protocol_MetricsInfo.NetInfo.LatencyInfo, rhs: Protocol_MetricsInfo.NetInfo.LatencyInfo) -> Bool { + if lhs.top99 != rhs.top99 {return false} + if lhs.top95 != rhs.top95 {return false} + if lhs.top75 != rhs.top75 {return false} + if lhs.totalCount != rhs.totalCount {return false} + if lhs.delay1S != rhs.delay1S {return false} + if lhs.delay2S != rhs.delay2S {return false} + if lhs.delay3S != rhs.delay3S {return false} + if lhs.detail != rhs.detail {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_Transaction.Result.code: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SUCESS"), - 1: .same(proto: "FAILED"), - ] -} - -extension Protocol_Transaction.Result.contractResult: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DEFAULT"), - 1: .same(proto: "SUCCESS"), - 2: .same(proto: "REVERT"), - 3: .same(proto: "BAD_JUMP_DESTINATION"), - 4: .same(proto: "OUT_OF_MEMORY"), - 5: .same(proto: "PRECOMPILED_CONTRACT"), - 6: .same(proto: "STACK_TOO_SMALL"), - 7: .same(proto: "STACK_TOO_LARGE"), - 8: .same(proto: "ILLEGAL_OPERATION"), - 9: .same(proto: "STACK_OVERFLOW"), - 10: .same(proto: "OUT_OF_ENERGY"), - 11: .same(proto: "OUT_OF_TIME"), - 12: .same(proto: "JVM_STACK_OVER_FLOW"), - 13: .same(proto: "UNKNOWN"), - 14: .same(proto: "TRANSFER_FAILED"), - 15: .same(proto: "INVALID_CODE"), - ] -} - -extension Protocol_Transaction.raw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Protocol_Transaction.protoMessageName + ".raw" +extension Protocol_MetricsInfo.NetInfo.LatencyInfo.LatencyDetailInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_MetricsInfo.NetInfo.LatencyInfo.protoMessageName + ".LatencyDetailInfo" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "ref_block_bytes"), - 3: .standard(proto: "ref_block_num"), - 4: .standard(proto: "ref_block_hash"), - 8: .same(proto: "expiration"), - 9: .same(proto: "auths"), - 10: .same(proto: "data"), - 11: .same(proto: "contract"), - 12: .same(proto: "scripts"), - 14: .same(proto: "timestamp"), - 18: .standard(proto: "fee_limit"), + 1: .same(proto: "witness"), + 2: .same(proto: "top99"), + 3: .same(proto: "top95"), + 4: .same(proto: "top75"), + 5: .same(proto: "count"), + 6: .same(proto: "delay1S"), + 7: .same(proto: "delay2S"), + 8: .same(proto: "delay3S"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1079,76 +8441,66 @@ extension Protocol_Transaction.raw: SwiftProtobuf.Message, SwiftProtobuf._Messag // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.refBlockBytes) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.refBlockNum) }() - case 4: try { try decoder.decodeSingularBytesField(value: &self.refBlockHash) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &self.expiration) }() - case 9: try { try decoder.decodeRepeatedMessageField(value: &self.auths) }() - case 10: try { try decoder.decodeSingularBytesField(value: &self.data) }() - case 11: try { try decoder.decodeRepeatedMessageField(value: &self.contract) }() - case 12: try { try decoder.decodeSingularBytesField(value: &self.scripts) }() - case 14: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() - case 18: try { try decoder.decodeSingularInt64Field(value: &self.feeLimit) }() + case 1: try { try decoder.decodeSingularStringField(value: &self.witness) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.top99) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.top95) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self.top75) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self.count) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &self.delay1S) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self.delay2S) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &self.delay3S) }() default: break } } } func traverse(visitor: inout V) throws { - if !self.refBlockBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.refBlockBytes, fieldNumber: 1) - } - if self.refBlockNum != 0 { - try visitor.visitSingularInt64Field(value: self.refBlockNum, fieldNumber: 3) - } - if !self.refBlockHash.isEmpty { - try visitor.visitSingularBytesField(value: self.refBlockHash, fieldNumber: 4) + if !self.witness.isEmpty { + try visitor.visitSingularStringField(value: self.witness, fieldNumber: 1) } - if self.expiration != 0 { - try visitor.visitSingularInt64Field(value: self.expiration, fieldNumber: 8) + if self.top99 != 0 { + try visitor.visitSingularInt32Field(value: self.top99, fieldNumber: 2) } - if !self.auths.isEmpty { - try visitor.visitRepeatedMessageField(value: self.auths, fieldNumber: 9) + if self.top95 != 0 { + try visitor.visitSingularInt32Field(value: self.top95, fieldNumber: 3) } - if !self.data.isEmpty { - try visitor.visitSingularBytesField(value: self.data, fieldNumber: 10) + if self.top75 != 0 { + try visitor.visitSingularInt32Field(value: self.top75, fieldNumber: 4) } - if !self.contract.isEmpty { - try visitor.visitRepeatedMessageField(value: self.contract, fieldNumber: 11) + if self.count != 0 { + try visitor.visitSingularInt32Field(value: self.count, fieldNumber: 5) } - if !self.scripts.isEmpty { - try visitor.visitSingularBytesField(value: self.scripts, fieldNumber: 12) + if self.delay1S != 0 { + try visitor.visitSingularInt32Field(value: self.delay1S, fieldNumber: 6) } - if self.timestamp != 0 { - try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 14) + if self.delay2S != 0 { + try visitor.visitSingularInt32Field(value: self.delay2S, fieldNumber: 7) } - if self.feeLimit != 0 { - try visitor.visitSingularInt64Field(value: self.feeLimit, fieldNumber: 18) + if self.delay3S != 0 { + try visitor.visitSingularInt32Field(value: self.delay3S, fieldNumber: 8) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_Transaction.raw, rhs: Protocol_Transaction.raw) -> Bool { - if lhs.refBlockBytes != rhs.refBlockBytes {return false} - if lhs.refBlockNum != rhs.refBlockNum {return false} - if lhs.refBlockHash != rhs.refBlockHash {return false} - if lhs.expiration != rhs.expiration {return false} - if lhs.auths != rhs.auths {return false} - if lhs.data != rhs.data {return false} - if lhs.contract != rhs.contract {return false} - if lhs.scripts != rhs.scripts {return false} - if lhs.timestamp != rhs.timestamp {return false} - if lhs.feeLimit != rhs.feeLimit {return false} + static func ==(lhs: Protocol_MetricsInfo.NetInfo.LatencyInfo.LatencyDetailInfo, rhs: Protocol_MetricsInfo.NetInfo.LatencyInfo.LatencyDetailInfo) -> Bool { + if lhs.witness != rhs.witness {return false} + if lhs.top99 != rhs.top99 {return false} + if lhs.top95 != rhs.top95 {return false} + if lhs.top75 != rhs.top75 {return false} + if lhs.count != rhs.count {return false} + if lhs.delay1S != rhs.delay1S {return false} + if lhs.delay2S != rhs.delay2S {return false} + if lhs.delay3S != rhs.delay3S {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_BlockHeader: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".BlockHeader" +extension Protocol_PBFTMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PBFTMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "raw_data"), - 2: .standard(proto: "witness_signature"), + 2: .same(proto: "signature"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1158,7 +8510,7 @@ extension Protocol_BlockHeader: SwiftProtobuf.Message, SwiftProtobuf._MessageImp // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularMessageField(value: &self._rawData) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.witnessSignature) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.signature) }() default: break } } @@ -1172,31 +8524,45 @@ extension Protocol_BlockHeader: SwiftProtobuf.Message, SwiftProtobuf._MessageImp try { if let v = self._rawData { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - if !self.witnessSignature.isEmpty { - try visitor.visitSingularBytesField(value: self.witnessSignature, fieldNumber: 2) + if !self.signature.isEmpty { + try visitor.visitSingularBytesField(value: self.signature, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_BlockHeader, rhs: Protocol_BlockHeader) -> Bool { + static func ==(lhs: Protocol_PBFTMessage, rhs: Protocol_PBFTMessage) -> Bool { if lhs._rawData != rhs._rawData {return false} - if lhs.witnessSignature != rhs.witnessSignature {return false} + if lhs.signature != rhs.signature {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_BlockHeader.raw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = Protocol_BlockHeader.protoMessageName + ".raw" +extension Protocol_PBFTMessage.MsgType: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "timestamp"), - 2: .same(proto: "txTrieRoot"), - 3: .same(proto: "parentHash"), - 7: .same(proto: "number"), - 8: .standard(proto: "witness_id"), - 9: .standard(proto: "witness_address"), - 10: .same(proto: "version"), - 11: .same(proto: "accountStateRoot"), + 0: .same(proto: "VIEW_CHANGE"), + 1: .same(proto: "REQUEST"), + 2: .same(proto: "PREPREPARE"), + 3: .same(proto: "PREPARE"), + 4: .same(proto: "COMMIT"), + ] +} + +extension Protocol_PBFTMessage.DataType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "BLOCK"), + 1: .same(proto: "SRL"), + ] +} + +extension Protocol_PBFTMessage.Raw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_PBFTMessage.protoMessageName + ".Raw" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "msg_type"), + 2: .standard(proto: "data_type"), + 3: .standard(proto: "view_n"), + 4: .same(proto: "epoch"), + 5: .same(proto: "data"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1205,66 +8571,88 @@ extension Protocol_BlockHeader.raw: SwiftProtobuf.Message, SwiftProtobuf._Messag // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.txTrieRoot) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.parentHash) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &self.number) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &self.witnessID) }() - case 9: try { try decoder.decodeSingularBytesField(value: &self.witnessAddress) }() - case 10: try { try decoder.decodeSingularInt32Field(value: &self.version) }() - case 11: try { try decoder.decodeSingularBytesField(value: &self.accountStateRoot) }() + case 1: try { try decoder.decodeSingularEnumField(value: &self.msgType) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.dataType) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.viewN) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.epoch) }() + case 5: try { try decoder.decodeSingularBytesField(value: &self.data) }() default: break } } } func traverse(visitor: inout V) throws { - if self.timestamp != 0 { - try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 1) + if self.msgType != .viewChange { + try visitor.visitSingularEnumField(value: self.msgType, fieldNumber: 1) } - if !self.txTrieRoot.isEmpty { - try visitor.visitSingularBytesField(value: self.txTrieRoot, fieldNumber: 2) + if self.dataType != .block { + try visitor.visitSingularEnumField(value: self.dataType, fieldNumber: 2) } - if !self.parentHash.isEmpty { - try visitor.visitSingularBytesField(value: self.parentHash, fieldNumber: 3) + if self.viewN != 0 { + try visitor.visitSingularInt64Field(value: self.viewN, fieldNumber: 3) } - if self.number != 0 { - try visitor.visitSingularInt64Field(value: self.number, fieldNumber: 7) + if self.epoch != 0 { + try visitor.visitSingularInt64Field(value: self.epoch, fieldNumber: 4) } - if self.witnessID != 0 { - try visitor.visitSingularInt64Field(value: self.witnessID, fieldNumber: 8) + if !self.data.isEmpty { + try visitor.visitSingularBytesField(value: self.data, fieldNumber: 5) } - if !self.witnessAddress.isEmpty { - try visitor.visitSingularBytesField(value: self.witnessAddress, fieldNumber: 9) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_PBFTMessage.Raw, rhs: Protocol_PBFTMessage.Raw) -> Bool { + if lhs.msgType != rhs.msgType {return false} + if lhs.dataType != rhs.dataType {return false} + if lhs.viewN != rhs.viewN {return false} + if lhs.epoch != rhs.epoch {return false} + if lhs.data != rhs.data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_PBFTCommitResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PBFTCommitResult" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + 2: .same(proto: "signature"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.data) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.signature) }() + default: break + } } - if self.version != 0 { - try visitor.visitSingularInt32Field(value: self.version, fieldNumber: 10) + } + + func traverse(visitor: inout V) throws { + if !self.data.isEmpty { + try visitor.visitSingularBytesField(value: self.data, fieldNumber: 1) } - if !self.accountStateRoot.isEmpty { - try visitor.visitSingularBytesField(value: self.accountStateRoot, fieldNumber: 11) + if !self.signature.isEmpty { + try visitor.visitRepeatedBytesField(value: self.signature, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_BlockHeader.raw, rhs: Protocol_BlockHeader.raw) -> Bool { - if lhs.timestamp != rhs.timestamp {return false} - if lhs.txTrieRoot != rhs.txTrieRoot {return false} - if lhs.parentHash != rhs.parentHash {return false} - if lhs.number != rhs.number {return false} - if lhs.witnessID != rhs.witnessID {return false} - if lhs.witnessAddress != rhs.witnessAddress {return false} - if lhs.version != rhs.version {return false} - if lhs.accountStateRoot != rhs.accountStateRoot {return false} + static func ==(lhs: Protocol_PBFTCommitResult, rhs: Protocol_PBFTCommitResult) -> Bool { + if lhs.data != rhs.data {return false} + if lhs.signature != rhs.signature {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_Block: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Block" +extension Protocol_SRL: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SRL" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "transactions"), - 2: .standard(proto: "block_header"), + 1: .same(proto: "srAddress"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1273,30 +8661,21 @@ extension Protocol_Block: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.transactions) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blockHeader) }() + case 1: try { try decoder.decodeRepeatedBytesField(value: &self.srAddress) }() default: break } } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.transactions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.transactions, fieldNumber: 1) + if !self.srAddress.isEmpty { + try visitor.visitRepeatedBytesField(value: self.srAddress, fieldNumber: 1) } - try { if let v = self._blockHeader { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_Block, rhs: Protocol_Block) -> Bool { - if lhs.transactions != rhs.transactions {return false} - if lhs._blockHeader != rhs._blockHeader {return false} + static func ==(lhs: Protocol_SRL, rhs: Protocol_SRL) -> Bool { + if lhs.srAddress != rhs.srAddress {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/Tron.proto b/BlockchainSdk/Blockchains/Tron/protobuf/Tron.proto deleted file mode 100644 index 28de6a366..000000000 --- a/BlockchainSdk/Blockchains/Tron/protobuf/Tron.proto +++ /dev/null @@ -1,901 +0,0 @@ -syntax = "proto3"; - -import "google/protobuf/any.proto"; -//import "core/Discover.proto"; - -package protocol; - - -option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file -option java_outer_classname = "Protocol"; //Specify the class name of the generated Java file -option go_package = "github.com/tronprotocol/grpc-gateway/core"; - -enum AccountType { - Normal = 0; - AssetIssue = 1; - Contract = 2; -} - -// AccountId, (name, address) use name, (null, address) use address, (name, null) use name, -message AccountId { - bytes name = 1; - bytes address = 2; -} - -/* -// vote message -message Vote { - // the super rep address - bytes vote_address = 1; - // the vote num to this super rep. - int64 vote_count = 2; -} - -// Proposal -message Proposal { - int64 proposal_id = 1; - bytes proposer_address = 2; - map parameters = 3; - int64 expiration_time = 4; - int64 create_time = 5; - repeated bytes approvals = 6; - enum State { - PENDING = 0; - DISAPPROVED = 1; - APPROVED = 2; - CANCELED = 3; - } - State state = 7; -} - -// Exchange -message Exchange { - int64 exchange_id = 1; - bytes creator_address = 2; - int64 create_time = 3; - bytes first_token_id = 6; - int64 first_token_balance = 7; - bytes second_token_id = 8; - int64 second_token_balance = 9; -} - -// market -message MarketOrder { - bytes order_id = 1; - bytes owner_address = 2; - int64 create_time = 3; - bytes sell_token_id = 4; - int64 sell_token_quantity = 5; - bytes buy_token_id = 6; - int64 buy_token_quantity = 7; // min to receive - int64 sell_token_quantity_remain = 9; - // When state != ACTIVE and sell_token_quantity_return !=0, - //it means that some sell tokens are returned to the account due to insufficient remaining amount - int64 sell_token_quantity_return = 10; - - enum State { - ACTIVE = 0; - INACTIVE = 1; - CANCELED = 2; - } - State state = 11; - - bytes prev = 12; - bytes next = 13; -} - -message MarketOrderList { - repeated MarketOrder orders = 1; -} - -message MarketOrderPairList { - repeated MarketOrderPair orderPair = 1; -} - -message MarketOrderPair{ - bytes sell_token_id = 1; - bytes buy_token_id = 2; -} - -message MarketAccountOrder { - bytes owner_address = 1; - repeated bytes orders = 2; // order_id list - int64 count = 3; // active count - int64 total_count = 4; -} - -message MarketPrice { - int64 sell_token_quantity = 1; - int64 buy_token_quantity = 2; -} - -message MarketPriceList { - bytes sell_token_id = 1; - bytes buy_token_id = 2; - repeated MarketPrice prices = 3; -} - -message MarketOrderIdList { - bytes head = 1; - bytes tail = 2; -} - -message ChainParameters { - repeated ChainParameter chainParameter = 1; - message ChainParameter { - string key = 1; - int64 value = 2; - } -} -*/ - -/* Account */ -/* -message Account { - */ - /* frozen balance */ -/* - message Frozen { - int64 frozen_balance = 1; // the frozen trx balance - int64 expire_time = 2; // the expire time - } - // account nick name - bytes account_name = 1; - AccountType type = 2; - // the create address - bytes address = 3; - // the trx balance - int64 balance = 4; - // the votes - repeated Vote votes = 5; - // the other asset owned by this account - map asset = 6; - - // the other asset owned by this account,key is assetId - map assetV2 = 56; - - // the frozen balance for bandwidth - repeated Frozen frozen = 7; - // bandwidth, get from frozen - int64 net_usage = 8; - //Frozen balance provided by other accounts to this account - int64 acquired_delegated_frozen_balance_for_bandwidth = 41; - //Freeze and provide balances to other accounts - int64 delegated_frozen_balance_for_bandwidth = 42; - - int64 old_Protocol_power = 46; - Frozen Protocol_power = 47; - - // this account create time - int64 create_time = 0x09; - // this last operation time, including transfer, voting and so on. //FIXME fix grammar - int64 latest_opration_time = 10; - // witness block producing allowance - int64 allowance = 0x0B; - // last withdraw time - int64 latest_withdraw_time = 0x0C; - // not used so far - bytes code = 13; - bool is_witness = 14; - bool is_committee = 15; - // frozen asset(for asset issuer) - repeated Frozen frozen_supply = 16; - // asset_issued_name - bytes asset_issued_name = 17; - bytes asset_issued_ID = 57; - map latest_asset_operation_time = 18; - map latest_asset_operation_timeV2 = 58; - int64 free_net_usage = 19; - map free_asset_net_usage = 20; - map free_asset_net_usageV2 = 59; - int64 latest_consume_time = 21; - int64 latest_consume_free_time = 22; - - // the identity of this account, case insensitive - bytes account_id = 23; - - message AccountResource { - // energy resource, get from frozen - int64 energy_usage = 1; - // the frozen balance for energy - Frozen frozen_balance_for_energy = 2; - int64 latest_consume_time_for_energy = 3; - - //Frozen balance provided by other accounts to this account - int64 acquired_delegated_frozen_balance_for_energy = 4; - //Frozen balances provided to other accounts - int64 delegated_frozen_balance_for_energy = 5; - - // storage resource, get from market - int64 storage_limit = 6; - int64 storage_usage = 7; - int64 latest_exchange_storage_time = 8; - - } - AccountResource account_resource = 26; - bytes codeHash = 30; - Permission owner_permission = 31; - Permission witness_permission = 32; - repeated Permission active_permission = 33; -} -*/ - -/* AccountAsset */ -/* -message AccountAsset { -*/ - - /* frozen balance */ -/* - message Frozen { - int64 frozen_balance = 1; // the frozen trx balance - int64 expire_time = 2; // the expire time - } - - // the create address - bytes address = 1; - - // the other asset owned by this account - map asset = 2; - - // the other asset owned by this account,key is assetId - map assetV2 = 3; - - bytes asset_issued_name = 4; - bytes asset_issued_ID = 5; - - map latest_asset_operation_time = 6; - map latest_asset_operation_timeV2 = 7; - - map free_asset_net_usage = 8; - map free_asset_net_usageV2 = 9; - - // frozen asset(for asset issuer) - repeated Frozen frozen_supply = 10; -} - - -message Key { - bytes address = 1; - int64 weight = 2; -} - -message DelegatedResource { - bytes from = 1; - bytes to = 2; - int64 frozen_balance_for_bandwidth = 3; - int64 frozen_balance_for_energy = 4; - int64 expire_time_for_bandwidth = 5; - int64 expire_time_for_energy = 6; -} -*/ - -message authority { - AccountId account = 1; - bytes permission_name = 2; -} - -/* -message Permission { - enum PermissionType { - Owner = 0; - Witness = 1; - Active = 2; - } - PermissionType type = 1; - int32 id = 2; //Owner id=0, Witness id=1, Active id start by 2 - string permission_name = 3; - int64 threshold = 4; - int32 parent_id = 5; - bytes operations = 6; //1 bit 1 contract - repeated Key keys = 7; -} - -// Witness -message Witness { - bytes address = 1; - int64 voteCount = 2; - bytes pubKey = 3; - string url = 4; - int64 totalProduced = 5; - int64 totalMissed = 6; - int64 latestBlockNum = 7; - int64 latestSlotNum = 8; - bool isJobs = 9; -} - -// Vote Change -message Votes { - bytes address = 1; - repeated Vote old_votes = 2; - repeated Vote new_votes = 3; -} - -// Transcation - -message TXOutput { - int64 value = 1; - bytes pubKeyHash = 2; -} - -message TXInput { - message raw { - bytes txID = 1; - int64 vout = 2; - bytes pubKey = 3; - } - raw raw_data = 1; - bytes signature = 4; -} - -message TXOutputs { - repeated TXOutput outputs = 1; -} - -message ResourceReceipt { - int64 energy_usage = 1; - int64 energy_fee = 2; - int64 origin_energy_usage = 3; - int64 energy_usage_total = 4; - int64 net_usage = 5; - int64 net_fee = 6; - Transaction.Result.contractResult result = 7; -} - */ - -message MarketOrderDetail { - bytes makerOrderId = 1; - bytes takerOrderId = 2; - int64 fillSellQuantity = 3; - int64 fillBuyQuantity = 4; -} - -message Transaction { - message Contract { - enum ContractType { - AccountCreateContract = 0; - TransferContract = 1; - TransferAssetContract = 2; - VoteAssetContract = 3; - VoteWitnessContract = 4; - WitnessCreateContract = 5; - AssetIssueContract = 6; - WitnessUpdateContract = 8; - ParticipateAssetIssueContract = 9; - AccountUpdateContract = 10; - FreezeBalanceContract = 11; - UnfreezeBalanceContract = 12; - WithdrawBalanceContract = 13; - UnfreezeAssetContract = 14; - UpdateAssetContract = 15; - ProposalCreateContract = 16; - ProposalApproveContract = 17; - ProposalDeleteContract = 18; - SetAccountIdContract = 19; - CustomContract = 20; - CreateSmartContract = 30; - TriggerSmartContract = 31; - GetContract = 32; - UpdateSettingContract = 33; - ExchangeCreateContract = 41; - ExchangeInjectContract = 42; - ExchangeWithdrawContract = 43; - ExchangeTransactionContract = 44; - UpdateEnergyLimitContract = 45; - AccountPermissionUpdateContract = 46; - ClearABIContract = 48; - UpdateBrokerageContract = 49; - ShieldedTransferContract = 51; - MarketSellAssetContract = 52; - MarketCancelOrderContract = 53; - } - ContractType type = 1; - google.protobuf.Any parameter = 2; - bytes provider = 3; - bytes ContractName = 4; - int32 Permission_id = 5; - } - - message Result { - enum code { - SUCESS = 0; - FAILED = 1; - } - enum contractResult { - DEFAULT = 0; - SUCCESS = 1; - REVERT = 2; - BAD_JUMP_DESTINATION = 3; - OUT_OF_MEMORY = 4; - PRECOMPILED_CONTRACT = 5; - STACK_TOO_SMALL = 6; - STACK_TOO_LARGE = 7; - ILLEGAL_OPERATION = 8; - STACK_OVERFLOW = 9; - OUT_OF_ENERGY = 10; - OUT_OF_TIME = 11; - JVM_STACK_OVER_FLOW = 12; - UNKNOWN = 13; - TRANSFER_FAILED = 14; - INVALID_CODE = 15; - } - int64 fee = 1; - code ret = 2; - contractResult contractRet = 3; - - string assetIssueID = 14; - int64 withdraw_amount = 15; - int64 unfreeze_amount = 16; - int64 exchange_received_amount = 18; - int64 exchange_inject_another_amount = 19; - int64 exchange_withdraw_another_amount = 20; - int64 exchange_id = 21; - int64 shielded_transaction_fee = 22; - - - bytes orderId = 25; - repeated MarketOrderDetail orderDetails = 26; - } - - message raw { - bytes ref_block_bytes = 1; - int64 ref_block_num = 3; - bytes ref_block_hash = 4; - int64 expiration = 8; - repeated authority auths = 9; - // data not used - bytes data = 10; - //only support size = 1, repeated list here for extension - repeated Contract contract = 11; - // scripts not used - bytes scripts = 12; - int64 timestamp = 14; - int64 fee_limit = 18; - } - - raw raw_data = 1; - // only support size = 1, repeated list here for muti-sig extension - repeated bytes signature = 2; - repeated Result ret = 5; -} - -/* -message TransactionInfo { - enum code { - SUCESS = 0; - FAILED = 1; - } - message Log { - bytes address = 1; - repeated bytes topics = 2; - bytes data = 3; - } - bytes id = 1; - int64 fee = 2; - int64 blockNumber = 3; - int64 blockTimeStamp = 4; - repeated bytes contractResult = 5; - bytes contract_address = 6; - ResourceReceipt receipt = 7; - repeated Log log = 8; - code result = 9; - bytes resMessage = 10; - - string assetIssueID = 14; - int64 withdraw_amount = 15; - int64 unfreeze_amount = 16; - repeated InternalTransaction internal_transactions = 17; - int64 exchange_received_amount = 18; - int64 exchange_inject_another_amount = 19; - int64 exchange_withdraw_another_amount = 20; - int64 exchange_id = 21; - int64 shielded_transaction_fee = 22; - - bytes orderId = 25; - repeated MarketOrderDetail orderDetails = 26; - int64 packingFee = 27; -} - -message TransactionRet { - int64 blockNumber = 1; - int64 blockTimeStamp = 2; - repeated TransactionInfo transactioninfo = 3; -} - -message Transactions { - repeated Transaction transactions = 1; -} - -message TransactionSign { - Transaction transaction = 1; - bytes privateKey = 2; -} -*/ - -message BlockHeader { - message raw { - int64 timestamp = 1; - bytes txTrieRoot = 2; - bytes parentHash = 3; - //bytes nonce = 5; - //bytes difficulty = 6; - int64 number = 7; - int64 witness_id = 8; - bytes witness_address = 9; - int32 version = 10; - bytes accountStateRoot = 11; - } - raw raw_data = 1; - bytes witness_signature = 2; -} - -// block -message Block { - repeated Transaction transactions = 1; - BlockHeader block_header = 2; -} - -/* -message ChainInventory { - message BlockId { - bytes hash = 1; - int64 number = 2; - } - repeated BlockId ids = 1; - int64 remain_num = 2; -} - -// Inventory -message BlockInventory { - enum Type { - SYNC = 0; - ADVTISE = 1; - FETCH = 2; - } - - message BlockId { - bytes hash = 1; - int64 number = 2; - } - repeated BlockId ids = 1; - Type type = 2; -} - -message Inventory { - enum InventoryType { - TRX = 0; - BLOCK = 1; - } - InventoryType type = 1; - repeated bytes ids = 2; -} - -message Items { - enum ItemType { - ERR = 0; - TRX = 1; - BLOCK = 2; - BLOCKHEADER = 3; - } - - ItemType type = 1; - repeated Block blocks = 2; - repeated BlockHeader block_headers = 3; - repeated Transaction transactions = 4; -} - -// DynamicProperties -message DynamicProperties { - int64 last_solidity_block_num = 1; -} - -enum ReasonCode { - REQUESTED = 0x00; - BAD_PROTOCOL = 0x02; - TOO_MANY_PEERS = 0x04; - DUPLICATE_PEER = 0x05; - INCOMPATIBLE_PROTOCOL = 0x06; - NULL_IDENTITY = 0x07; - PEER_QUITING = 0x08; - UNEXPECTED_IDENTITY = 0x09; - LOCAL_IDENTITY = 0x0A; - PING_TIMEOUT = 0x0B; - USER_REASON = 0x10; - RESET = 0x11; - SYNC_FAIL = 0x12; - FETCH_FAIL = 0x13; - BAD_TX = 0x14; - BAD_BLOCK = 0x15; - FORKED = 0x16; - UNLINKABLE = 0x17; - INCOMPATIBLE_VERSION = 0x18; - INCOMPATIBLE_CHAIN = 0x19; - TIME_OUT = 0x20; - CONNECT_FAIL = 0x21; - TOO_MANY_PEERS_WITH_SAME_IP = 0x22; - UNKNOWN = 0xFF; -} - -message DisconnectMessage { - ReasonCode reason = 1; -} -*/ -/* -message HelloMessage { - message BlockId { - bytes hash = 1; - int64 number = 2; - } - - Endpoint from = 1; - int32 version = 2; - int64 timestamp = 3; - BlockId genesisBlockId = 4; - BlockId solidBlockId = 5; - BlockId headBlockId = 6; - bytes address = 7; - bytes signature = 8; -} -*/ -/* -message InternalTransaction { - // internalTransaction identity, the root InternalTransaction hash - // should equals to root transaction id. - bytes hash = 1; - // the one send trx (TBD: or token) via function - bytes caller_address = 2; - // the one recieve trx (TBD: or token) via function - bytes transferTo_address = 3; - message CallValueInfo { - // trx (TBD: or token) value - int64 callValue = 1; - // TBD: tokenName, trx should be empty - string tokenId = 2; - } - repeated CallValueInfo callValueInfo = 4; - bytes note = 5; - bool rejected = 6; - string extra = 7; -} - -message DelegatedResourceAccountIndex { - bytes account = 1; - repeated bytes fromAccounts = 2; - repeated bytes toAccounts = 3; -} - -message NodeInfo { - int64 beginSyncNum = 1; - string block = 2; - string solidityBlock = 3; - //connect information - int32 currentConnectCount = 4; - int32 activeConnectCount = 5; - int32 passiveConnectCount = 6; - int64 totalFlow = 7; - repeated PeerInfo peerInfoList = 8; - ConfigNodeInfo configNodeInfo = 9; - MachineInfo machineInfo = 10; - map cheatWitnessInfoMap = 11; - - message PeerInfo { - string lastSyncBlock = 1; - int64 remainNum = 2; - int64 lastBlockUpdateTime = 3; - bool syncFlag = 4; - int64 headBlockTimeWeBothHave = 5; - bool needSyncFromPeer = 6; - bool needSyncFromUs = 7; - string host = 8; - int32 port = 9; - string nodeId = 10; - int64 connectTime = 11; - double avgLatency = 12; - int32 syncToFetchSize = 13; - int64 syncToFetchSizePeekNum = 14; - int32 syncBlockRequestedSize = 15; - int64 unFetchSynNum = 16; - int32 blockInPorcSize = 17; - string headBlockWeBothHave = 18; - bool isActive = 19; - int32 score = 20; - int32 nodeCount = 21; - int64 inFlow = 22; - int32 disconnectTimes = 23; - string localDisconnectReason = 24; - string remoteDisconnectReason = 25; - } - - message ConfigNodeInfo { - string codeVersion = 1; - string p2pVersion = 2; - int32 listenPort = 3; - bool discoverEnable = 4; - int32 activeNodeSize = 5; - int32 passiveNodeSize = 6; - int32 sendNodeSize = 7; - int32 maxConnectCount = 8; - int32 sameIpMaxConnectCount = 9; - int32 backupListenPort = 10; - int32 backupMemberSize = 11; - int32 backupPriority = 12; - int32 dbVersion = 13; - int32 minParticipationRate = 14; - bool supportConstant = 15; - double minTimeRatio = 16; - double maxTimeRatio = 17; - int64 allowCreationOfContracts = 18; - int64 allowAdaptiveEnergy = 19; - } - - message MachineInfo { - int32 threadCount = 1; - int32 deadLockThreadCount = 2; - int32 cpuCount = 3; - int64 totalMemory = 4; - int64 freeMemory = 5; - double cpuRate = 6; - string javaVersion = 7; - string osName = 8; - int64 jvmTotalMemory = 9; - int64 jvmFreeMemory = 10; - double processCpuRate = 11; - repeated MemoryDescInfo memoryDescInfoList = 12; - repeated DeadLockThreadInfo deadLockThreadInfoList = 13; - - message MemoryDescInfo { - string name = 1; - int64 initSize = 2; - int64 useSize = 3; - int64 maxSize = 4; - double useRate = 5; - } - - message DeadLockThreadInfo { - string name = 1; - string lockName = 2; - string lockOwner = 3; - string state = 4; - int64 blockTime = 5; - int64 waitTime = 6; - string stackTrace = 7; - } - } -} - -message MetricsInfo { - int64 interval = 1; - NodeInfo node = 2; - BlockChainInfo blockchain = 3; - NetInfo net = 4; - - message NodeInfo { - string ip = 1; - int32 nodeType = 2; - string version = 3; - int32 backupStatus = 4; - } - - message BlockChainInfo { - int64 headBlockNum = 1; - int64 headBlockTimestamp = 2; - string headBlockHash = 3; - int32 forkCount = 4; - int32 failForkCount = 5; - RateInfo blockProcessTime = 6; - RateInfo tps = 7; - int32 transactionCacheSize = 8; - RateInfo missedTransaction = 9; - repeated Witness witnesses = 10; - int64 failProcessBlockNum = 11; - string failProcessBlockReason = 12; - repeated DupWitness dupWitness = 13; - - message Witness { - string address = 1; - int32 version = 2; - } - - message DupWitness { - string address = 1; - int64 blockNum = 2; - int32 count = 3; - } - } - - message RateInfo { - int64 count = 1; - double meanRate = 2; - double oneMinuteRate = 3; - double fiveMinuteRate = 4; - double fifteenMinuteRate = 5; - } - - message NetInfo { - int32 errorProtoCount = 1; - ApiInfo api = 2; - int32 connectionCount = 3; - int32 validConnectionCount = 4; - RateInfo tcpInTraffic = 5; - RateInfo tcpOutTraffic = 6; - int32 disconnectionCount = 7; - repeated DisconnectionDetailInfo disconnectionDetail = 8; - RateInfo udpInTraffic = 9; - RateInfo udpOutTraffic = 10; - LatencyInfo latency = 11; - - message ApiInfo { - RateInfo qps = 1; - RateInfo failQps = 2; - RateInfo outTraffic = 3; - repeated ApiDetailInfo detail = 4; - - message ApiDetailInfo { - string name = 1; - RateInfo qps = 2; - RateInfo failQps = 3; - RateInfo outTraffic = 4; - } - } - - message DisconnectionDetailInfo { - string reason = 1; - int32 count = 2; - } - - message LatencyInfo { - int32 top99 = 1; - int32 top95 = 2; - int32 top75 = 3; - int32 totalCount = 4; - int32 delay1S = 5; - int32 delay2S = 6; - int32 delay3S = 7; - repeated LatencyDetailInfo detail = 8; - - message LatencyDetailInfo { - string witness = 1; - int32 top99 = 2; - int32 top95 = 3; - int32 top75 = 4; - int32 count = 5; - int32 delay1S = 6; - int32 delay2S = 7; - int32 delay3S = 8; - } - } - } -} - -message PBFTMessage { - enum MsgType { - VIEW_CHANGE = 0; - REQUEST = 1; - PREPREPARE = 2; - PREPARE = 3; - COMMIT = 4; - } - enum DataType { - BLOCK = 0; - SRL = 1; - } - message Raw { - MsgType msg_type = 1; - DataType data_type = 2; - int64 view_n = 3; - int64 epoch = 4; - bytes data = 5; - } - Raw raw_data = 1; - bytes signature = 2; -} - -message PBFTCommitResult { - bytes data = 1; - repeated bytes signature = 2; -} - -message SRL { - repeated bytes srAddress = 1; -} -*/ diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/TronInventoryItems.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/TronInventoryItems.pb.swift new file mode 100644 index 000000000..9860e616a --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/TronInventoryItems.pb.swift @@ -0,0 +1,77 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: TronInventoryItems.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_InventoryItems: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Int32 = 0 + + var items: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_InventoryItems: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".InventoryItems" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .same(proto: "items"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.type) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.items) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.type != 0 { + try visitor.visitSingularInt32Field(value: self.type, fieldNumber: 1) + } + if !self.items.isEmpty { + try visitor.visitRepeatedBytesField(value: self.items, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_InventoryItems, rhs: Protocol_InventoryItems) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.items != rhs.items {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/account_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/account_contract.pb.swift new file mode 100644 index 000000000..d0dacd083 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/account_contract.pb.swift @@ -0,0 +1,297 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/account_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// +// java-tron is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// java-tron is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_AccountCreateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var accountAddress: Data = Data() + + var type: Protocol_AccountType = .normal + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Update account name. Account name is not unique now. +struct Protocol_AccountUpdateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var accountName: Data = Data() + + var ownerAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Set account id if the account has no id. Account id is unique and case insensitive. +struct Protocol_SetAccountIdContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var accountID: Data = Data() + + var ownerAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_AccountPermissionUpdateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + ///Empty is invalidate + var owner: Protocol_Permission { + get {return _owner ?? Protocol_Permission()} + set {_owner = newValue} + } + /// Returns true if `owner` has been explicitly set. + var hasOwner: Bool {return self._owner != nil} + /// Clears the value of `owner`. Subsequent reads from it will return its default value. + mutating func clearOwner() {self._owner = nil} + + ///Can be empty + var witness: Protocol_Permission { + get {return _witness ?? Protocol_Permission()} + set {_witness = newValue} + } + /// Returns true if `witness` has been explicitly set. + var hasWitness: Bool {return self._witness != nil} + /// Clears the value of `witness`. Subsequent reads from it will return its default value. + mutating func clearWitness() {self._witness = nil} + + ///Empty is invalidate + var actives: [Protocol_Permission] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _owner: Protocol_Permission? = nil + fileprivate var _witness: Protocol_Permission? = nil +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_AccountCreateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountCreateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "account_address"), + 3: .same(proto: "type"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.accountAddress) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.type) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.accountAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.accountAddress, fieldNumber: 2) + } + if self.type != .normal { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountCreateContract, rhs: Protocol_AccountCreateContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.accountAddress != rhs.accountAddress {return false} + if lhs.type != rhs.type {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AccountUpdateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountUpdateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "account_name"), + 2: .standard(proto: "owner_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.accountName) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.accountName.isEmpty { + try visitor.visitSingularBytesField(value: self.accountName, fieldNumber: 1) + } + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountUpdateContract, rhs: Protocol_AccountUpdateContract) -> Bool { + if lhs.accountName != rhs.accountName {return false} + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SetAccountIdContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SetAccountIdContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "account_id"), + 2: .standard(proto: "owner_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.accountID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.accountID.isEmpty { + try visitor.visitSingularBytesField(value: self.accountID, fieldNumber: 1) + } + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SetAccountIdContract, rhs: Protocol_SetAccountIdContract) -> Bool { + if lhs.accountID != rhs.accountID {return false} + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AccountPermissionUpdateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountPermissionUpdateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "owner"), + 3: .same(proto: "witness"), + 4: .same(proto: "actives"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._owner) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._witness) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.actives) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + try { if let v = self._owner { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._witness { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.actives.isEmpty { + try visitor.visitRepeatedMessageField(value: self.actives, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountPermissionUpdateContract, rhs: Protocol_AccountPermissionUpdateContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs._owner != rhs._owner {return false} + if lhs._witness != rhs._witness {return false} + if lhs.actives != rhs.actives {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/asset_issue_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/asset_issue_contract.pb.swift new file mode 100644 index 000000000..8853494cf --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/asset_issue_contract.pb.swift @@ -0,0 +1,660 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/asset_issue_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_AssetIssueContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var id: String { + get {return _storage._id} + set {_uniqueStorage()._id = newValue} + } + + var ownerAddress: Data { + get {return _storage._ownerAddress} + set {_uniqueStorage()._ownerAddress = newValue} + } + + var name: Data { + get {return _storage._name} + set {_uniqueStorage()._name = newValue} + } + + var abbr: Data { + get {return _storage._abbr} + set {_uniqueStorage()._abbr = newValue} + } + + var totalSupply: Int64 { + get {return _storage._totalSupply} + set {_uniqueStorage()._totalSupply = newValue} + } + + var frozenSupply: [Protocol_AssetIssueContract.FrozenSupply] { + get {return _storage._frozenSupply} + set {_uniqueStorage()._frozenSupply = newValue} + } + + var trxNum: Int32 { + get {return _storage._trxNum} + set {_uniqueStorage()._trxNum = newValue} + } + + var precision: Int32 { + get {return _storage._precision} + set {_uniqueStorage()._precision = newValue} + } + + var num: Int32 { + get {return _storage._num} + set {_uniqueStorage()._num = newValue} + } + + var startTime: Int64 { + get {return _storage._startTime} + set {_uniqueStorage()._startTime = newValue} + } + + var endTime: Int64 { + get {return _storage._endTime} + set {_uniqueStorage()._endTime = newValue} + } + + /// useless + var order: Int64 { + get {return _storage._order} + set {_uniqueStorage()._order = newValue} + } + + var voteScore: Int32 { + get {return _storage._voteScore} + set {_uniqueStorage()._voteScore = newValue} + } + + var description_p: Data { + get {return _storage._description_p} + set {_uniqueStorage()._description_p = newValue} + } + + var url: Data { + get {return _storage._url} + set {_uniqueStorage()._url = newValue} + } + + var freeAssetNetLimit: Int64 { + get {return _storage._freeAssetNetLimit} + set {_uniqueStorage()._freeAssetNetLimit = newValue} + } + + var publicFreeAssetNetLimit: Int64 { + get {return _storage._publicFreeAssetNetLimit} + set {_uniqueStorage()._publicFreeAssetNetLimit = newValue} + } + + var publicFreeAssetNetUsage: Int64 { + get {return _storage._publicFreeAssetNetUsage} + set {_uniqueStorage()._publicFreeAssetNetUsage = newValue} + } + + var publicLatestFreeNetTime: Int64 { + get {return _storage._publicLatestFreeNetTime} + set {_uniqueStorage()._publicLatestFreeNetTime = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct FrozenSupply: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var frozenAmount: Int64 = 0 + + var frozenDays: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Protocol_TransferAssetContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format. + var assetName: Data = Data() + + var ownerAddress: Data = Data() + + var toAddress: Data = Data() + + var amount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UnfreezeAssetContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UpdateAssetContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var description_p: Data = Data() + + var url: Data = Data() + + var newLimit: Int64 = 0 + + var newPublicLimit: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ParticipateAssetIssueContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var toAddress: Data = Data() + + /// this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format. + var assetName: Data = Data() + + /// the amount of drops + var amount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_AssetIssueContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AssetIssueContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 41: .same(proto: "id"), + 1: .standard(proto: "owner_address"), + 2: .same(proto: "name"), + 3: .same(proto: "abbr"), + 4: .standard(proto: "total_supply"), + 5: .standard(proto: "frozen_supply"), + 6: .standard(proto: "trx_num"), + 7: .same(proto: "precision"), + 8: .same(proto: "num"), + 9: .standard(proto: "start_time"), + 10: .standard(proto: "end_time"), + 11: .same(proto: "order"), + 16: .standard(proto: "vote_score"), + 20: .same(proto: "description"), + 21: .same(proto: "url"), + 22: .standard(proto: "free_asset_net_limit"), + 23: .standard(proto: "public_free_asset_net_limit"), + 24: .standard(proto: "public_free_asset_net_usage"), + 25: .standard(proto: "public_latest_free_net_time"), + ] + + fileprivate class _StorageClass { + var _id: String = String() + var _ownerAddress: Data = Data() + var _name: Data = Data() + var _abbr: Data = Data() + var _totalSupply: Int64 = 0 + var _frozenSupply: [Protocol_AssetIssueContract.FrozenSupply] = [] + var _trxNum: Int32 = 0 + var _precision: Int32 = 0 + var _num: Int32 = 0 + var _startTime: Int64 = 0 + var _endTime: Int64 = 0 + var _order: Int64 = 0 + var _voteScore: Int32 = 0 + var _description_p: Data = Data() + var _url: Data = Data() + var _freeAssetNetLimit: Int64 = 0 + var _publicFreeAssetNetLimit: Int64 = 0 + var _publicFreeAssetNetUsage: Int64 = 0 + var _publicLatestFreeNetTime: Int64 = 0 + + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif + + private init() {} + + init(copying source: _StorageClass) { + _id = source._id + _ownerAddress = source._ownerAddress + _name = source._name + _abbr = source._abbr + _totalSupply = source._totalSupply + _frozenSupply = source._frozenSupply + _trxNum = source._trxNum + _precision = source._precision + _num = source._num + _startTime = source._startTime + _endTime = source._endTime + _order = source._order + _voteScore = source._voteScore + _description_p = source._description_p + _url = source._url + _freeAssetNetLimit = source._freeAssetNetLimit + _publicFreeAssetNetLimit = source._publicFreeAssetNetLimit + _publicFreeAssetNetUsage = source._publicFreeAssetNetUsage + _publicLatestFreeNetTime = source._publicLatestFreeNetTime + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &_storage._ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &_storage._name) }() + case 3: try { try decoder.decodeSingularBytesField(value: &_storage._abbr) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &_storage._totalSupply) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &_storage._frozenSupply) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._trxNum) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._precision) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._num) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &_storage._startTime) }() + case 10: try { try decoder.decodeSingularInt64Field(value: &_storage._endTime) }() + case 11: try { try decoder.decodeSingularInt64Field(value: &_storage._order) }() + case 16: try { try decoder.decodeSingularInt32Field(value: &_storage._voteScore) }() + case 20: try { try decoder.decodeSingularBytesField(value: &_storage._description_p) }() + case 21: try { try decoder.decodeSingularBytesField(value: &_storage._url) }() + case 22: try { try decoder.decodeSingularInt64Field(value: &_storage._freeAssetNetLimit) }() + case 23: try { try decoder.decodeSingularInt64Field(value: &_storage._publicFreeAssetNetLimit) }() + case 24: try { try decoder.decodeSingularInt64Field(value: &_storage._publicFreeAssetNetUsage) }() + case 25: try { try decoder.decodeSingularInt64Field(value: &_storage._publicLatestFreeNetTime) }() + case 41: try { try decoder.decodeSingularStringField(value: &_storage._id) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: _storage._ownerAddress, fieldNumber: 1) + } + if !_storage._name.isEmpty { + try visitor.visitSingularBytesField(value: _storage._name, fieldNumber: 2) + } + if !_storage._abbr.isEmpty { + try visitor.visitSingularBytesField(value: _storage._abbr, fieldNumber: 3) + } + if _storage._totalSupply != 0 { + try visitor.visitSingularInt64Field(value: _storage._totalSupply, fieldNumber: 4) + } + if !_storage._frozenSupply.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._frozenSupply, fieldNumber: 5) + } + if _storage._trxNum != 0 { + try visitor.visitSingularInt32Field(value: _storage._trxNum, fieldNumber: 6) + } + if _storage._precision != 0 { + try visitor.visitSingularInt32Field(value: _storage._precision, fieldNumber: 7) + } + if _storage._num != 0 { + try visitor.visitSingularInt32Field(value: _storage._num, fieldNumber: 8) + } + if _storage._startTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._startTime, fieldNumber: 9) + } + if _storage._endTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._endTime, fieldNumber: 10) + } + if _storage._order != 0 { + try visitor.visitSingularInt64Field(value: _storage._order, fieldNumber: 11) + } + if _storage._voteScore != 0 { + try visitor.visitSingularInt32Field(value: _storage._voteScore, fieldNumber: 16) + } + if !_storage._description_p.isEmpty { + try visitor.visitSingularBytesField(value: _storage._description_p, fieldNumber: 20) + } + if !_storage._url.isEmpty { + try visitor.visitSingularBytesField(value: _storage._url, fieldNumber: 21) + } + if _storage._freeAssetNetLimit != 0 { + try visitor.visitSingularInt64Field(value: _storage._freeAssetNetLimit, fieldNumber: 22) + } + if _storage._publicFreeAssetNetLimit != 0 { + try visitor.visitSingularInt64Field(value: _storage._publicFreeAssetNetLimit, fieldNumber: 23) + } + if _storage._publicFreeAssetNetUsage != 0 { + try visitor.visitSingularInt64Field(value: _storage._publicFreeAssetNetUsage, fieldNumber: 24) + } + if _storage._publicLatestFreeNetTime != 0 { + try visitor.visitSingularInt64Field(value: _storage._publicLatestFreeNetTime, fieldNumber: 25) + } + if !_storage._id.isEmpty { + try visitor.visitSingularStringField(value: _storage._id, fieldNumber: 41) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AssetIssueContract, rhs: Protocol_AssetIssueContract) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._id != rhs_storage._id {return false} + if _storage._ownerAddress != rhs_storage._ownerAddress {return false} + if _storage._name != rhs_storage._name {return false} + if _storage._abbr != rhs_storage._abbr {return false} + if _storage._totalSupply != rhs_storage._totalSupply {return false} + if _storage._frozenSupply != rhs_storage._frozenSupply {return false} + if _storage._trxNum != rhs_storage._trxNum {return false} + if _storage._precision != rhs_storage._precision {return false} + if _storage._num != rhs_storage._num {return false} + if _storage._startTime != rhs_storage._startTime {return false} + if _storage._endTime != rhs_storage._endTime {return false} + if _storage._order != rhs_storage._order {return false} + if _storage._voteScore != rhs_storage._voteScore {return false} + if _storage._description_p != rhs_storage._description_p {return false} + if _storage._url != rhs_storage._url {return false} + if _storage._freeAssetNetLimit != rhs_storage._freeAssetNetLimit {return false} + if _storage._publicFreeAssetNetLimit != rhs_storage._publicFreeAssetNetLimit {return false} + if _storage._publicFreeAssetNetUsage != rhs_storage._publicFreeAssetNetUsage {return false} + if _storage._publicLatestFreeNetTime != rhs_storage._publicLatestFreeNetTime {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AssetIssueContract.FrozenSupply: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_AssetIssueContract.protoMessageName + ".FrozenSupply" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "frozen_amount"), + 2: .standard(proto: "frozen_days"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.frozenAmount) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.frozenDays) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.frozenAmount != 0 { + try visitor.visitSingularInt64Field(value: self.frozenAmount, fieldNumber: 1) + } + if self.frozenDays != 0 { + try visitor.visitSingularInt64Field(value: self.frozenDays, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AssetIssueContract.FrozenSupply, rhs: Protocol_AssetIssueContract.FrozenSupply) -> Bool { + if lhs.frozenAmount != rhs.frozenAmount {return false} + if lhs.frozenDays != rhs.frozenDays {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransferAssetContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TransferAssetContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "asset_name"), + 2: .standard(proto: "owner_address"), + 3: .standard(proto: "to_address"), + 4: .same(proto: "amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.assetName) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.toAddress) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.amount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.assetName.isEmpty { + try visitor.visitSingularBytesField(value: self.assetName, fieldNumber: 1) + } + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 2) + } + if !self.toAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.toAddress, fieldNumber: 3) + } + if self.amount != 0 { + try visitor.visitSingularInt64Field(value: self.amount, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransferAssetContract, rhs: Protocol_TransferAssetContract) -> Bool { + if lhs.assetName != rhs.assetName {return false} + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.toAddress != rhs.toAddress {return false} + if lhs.amount != rhs.amount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UnfreezeAssetContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UnfreezeAssetContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UnfreezeAssetContract, rhs: Protocol_UnfreezeAssetContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UpdateAssetContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UpdateAssetContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "description"), + 3: .same(proto: "url"), + 4: .standard(proto: "new_limit"), + 5: .standard(proto: "new_public_limit"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.description_p) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.url) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.newLimit) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.newPublicLimit) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.description_p.isEmpty { + try visitor.visitSingularBytesField(value: self.description_p, fieldNumber: 2) + } + if !self.url.isEmpty { + try visitor.visitSingularBytesField(value: self.url, fieldNumber: 3) + } + if self.newLimit != 0 { + try visitor.visitSingularInt64Field(value: self.newLimit, fieldNumber: 4) + } + if self.newPublicLimit != 0 { + try visitor.visitSingularInt64Field(value: self.newPublicLimit, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UpdateAssetContract, rhs: Protocol_UpdateAssetContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.description_p != rhs.description_p {return false} + if lhs.url != rhs.url {return false} + if lhs.newLimit != rhs.newLimit {return false} + if lhs.newPublicLimit != rhs.newPublicLimit {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ParticipateAssetIssueContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ParticipateAssetIssueContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "to_address"), + 3: .standard(proto: "asset_name"), + 4: .same(proto: "amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.toAddress) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.assetName) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.amount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.toAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.toAddress, fieldNumber: 2) + } + if !self.assetName.isEmpty { + try visitor.visitSingularBytesField(value: self.assetName, fieldNumber: 3) + } + if self.amount != 0 { + try visitor.visitSingularInt64Field(value: self.amount, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ParticipateAssetIssueContract, rhs: Protocol_ParticipateAssetIssueContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.toAddress != rhs.toAddress {return false} + if lhs.assetName != rhs.assetName {return false} + if lhs.amount != rhs.amount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/balance_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/balance_contract.pb.swift new file mode 100644 index 000000000..34a27f446 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/balance_contract.pb.swift @@ -0,0 +1,1113 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/balance_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_FreezeBalanceContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var frozenBalance: Int64 = 0 + + var frozenDuration: Int64 = 0 + + var resource: Protocol_ResourceCode = .bandwidth + + var receiverAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UnfreezeBalanceContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var resource: Protocol_ResourceCode = .bandwidth + + var receiverAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_WithdrawBalanceContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_TransferContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var toAddress: Data = Data() + + var amount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_TransactionBalanceTrace: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var transactionIdentifier: Data = Data() + + var operation: [Protocol_TransactionBalanceTrace.Operation] = [] + + var type: String = String() + + var status: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Operation: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var operationIdentifier: Int64 = 0 + + var address: Data = Data() + + var amount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} +} + +struct Protocol_BlockBalanceTrace: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var blockIdentifier: Protocol_BlockBalanceTrace.BlockIdentifier { + get {return _blockIdentifier ?? Protocol_BlockBalanceTrace.BlockIdentifier()} + set {_blockIdentifier = newValue} + } + /// Returns true if `blockIdentifier` has been explicitly set. + var hasBlockIdentifier: Bool {return self._blockIdentifier != nil} + /// Clears the value of `blockIdentifier`. Subsequent reads from it will return its default value. + mutating func clearBlockIdentifier() {self._blockIdentifier = nil} + + var timestamp: Int64 = 0 + + /// BlockIdentifier parent_block_identifier = 4; + var transactionBalanceTrace: [Protocol_TransactionBalanceTrace] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct BlockIdentifier: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var hash: Data = Data() + + var number: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _blockIdentifier: Protocol_BlockBalanceTrace.BlockIdentifier? = nil +} + +struct Protocol_AccountTrace: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var balance: Int64 = 0 + + var placeholder: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_AccountIdentifier: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var address: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_AccountBalanceRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var accountIdentifier: Protocol_AccountIdentifier { + get {return _accountIdentifier ?? Protocol_AccountIdentifier()} + set {_accountIdentifier = newValue} + } + /// Returns true if `accountIdentifier` has been explicitly set. + var hasAccountIdentifier: Bool {return self._accountIdentifier != nil} + /// Clears the value of `accountIdentifier`. Subsequent reads from it will return its default value. + mutating func clearAccountIdentifier() {self._accountIdentifier = nil} + + var blockIdentifier: Protocol_BlockBalanceTrace.BlockIdentifier { + get {return _blockIdentifier ?? Protocol_BlockBalanceTrace.BlockIdentifier()} + set {_blockIdentifier = newValue} + } + /// Returns true if `blockIdentifier` has been explicitly set. + var hasBlockIdentifier: Bool {return self._blockIdentifier != nil} + /// Clears the value of `blockIdentifier`. Subsequent reads from it will return its default value. + mutating func clearBlockIdentifier() {self._blockIdentifier = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _accountIdentifier: Protocol_AccountIdentifier? = nil + fileprivate var _blockIdentifier: Protocol_BlockBalanceTrace.BlockIdentifier? = nil +} + +struct Protocol_AccountBalanceResponse: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var balance: Int64 = 0 + + var blockIdentifier: Protocol_BlockBalanceTrace.BlockIdentifier { + get {return _blockIdentifier ?? Protocol_BlockBalanceTrace.BlockIdentifier()} + set {_blockIdentifier = newValue} + } + /// Returns true if `blockIdentifier` has been explicitly set. + var hasBlockIdentifier: Bool {return self._blockIdentifier != nil} + /// Clears the value of `blockIdentifier`. Subsequent reads from it will return its default value. + mutating func clearBlockIdentifier() {self._blockIdentifier = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _blockIdentifier: Protocol_BlockBalanceTrace.BlockIdentifier? = nil +} + +struct Protocol_FreezeBalanceV2Contract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var frozenBalance: Int64 = 0 + + var resource: Protocol_ResourceCode = .bandwidth + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UnfreezeBalanceV2Contract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var unfreezeBalance: Int64 = 0 + + var resource: Protocol_ResourceCode = .bandwidth + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_WithdrawExpireUnfreezeContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_DelegateResourceContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var resource: Protocol_ResourceCode = .bandwidth + + var balance: Int64 = 0 + + var receiverAddress: Data = Data() + + var lock: Bool = false + + var lockPeriod: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UnDelegateResourceContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var resource: Protocol_ResourceCode = .bandwidth + + var balance: Int64 = 0 + + var receiverAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_CancelAllUnfreezeV2Contract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_FreezeBalanceContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FreezeBalanceContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "frozen_balance"), + 3: .standard(proto: "frozen_duration"), + 10: .same(proto: "resource"), + 15: .standard(proto: "receiver_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.frozenBalance) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.frozenDuration) }() + case 10: try { try decoder.decodeSingularEnumField(value: &self.resource) }() + case 15: try { try decoder.decodeSingularBytesField(value: &self.receiverAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.frozenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.frozenBalance, fieldNumber: 2) + } + if self.frozenDuration != 0 { + try visitor.visitSingularInt64Field(value: self.frozenDuration, fieldNumber: 3) + } + if self.resource != .bandwidth { + try visitor.visitSingularEnumField(value: self.resource, fieldNumber: 10) + } + if !self.receiverAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.receiverAddress, fieldNumber: 15) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_FreezeBalanceContract, rhs: Protocol_FreezeBalanceContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.frozenBalance != rhs.frozenBalance {return false} + if lhs.frozenDuration != rhs.frozenDuration {return false} + if lhs.resource != rhs.resource {return false} + if lhs.receiverAddress != rhs.receiverAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UnfreezeBalanceContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UnfreezeBalanceContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 10: .same(proto: "resource"), + 15: .standard(proto: "receiver_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 10: try { try decoder.decodeSingularEnumField(value: &self.resource) }() + case 15: try { try decoder.decodeSingularBytesField(value: &self.receiverAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.resource != .bandwidth { + try visitor.visitSingularEnumField(value: self.resource, fieldNumber: 10) + } + if !self.receiverAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.receiverAddress, fieldNumber: 15) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UnfreezeBalanceContract, rhs: Protocol_UnfreezeBalanceContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.resource != rhs.resource {return false} + if lhs.receiverAddress != rhs.receiverAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_WithdrawBalanceContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".WithdrawBalanceContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_WithdrawBalanceContract, rhs: Protocol_WithdrawBalanceContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransferContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TransferContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "to_address"), + 3: .same(proto: "amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.toAddress) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.amount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.toAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.toAddress, fieldNumber: 2) + } + if self.amount != 0 { + try visitor.visitSingularInt64Field(value: self.amount, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransferContract, rhs: Protocol_TransferContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.toAddress != rhs.toAddress {return false} + if lhs.amount != rhs.amount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransactionBalanceTrace: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TransactionBalanceTrace" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "transaction_identifier"), + 2: .same(proto: "operation"), + 3: .same(proto: "type"), + 4: .same(proto: "status"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.transactionIdentifier) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.operation) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.type) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.status) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.transactionIdentifier.isEmpty { + try visitor.visitSingularBytesField(value: self.transactionIdentifier, fieldNumber: 1) + } + if !self.operation.isEmpty { + try visitor.visitRepeatedMessageField(value: self.operation, fieldNumber: 2) + } + if !self.type.isEmpty { + try visitor.visitSingularStringField(value: self.type, fieldNumber: 3) + } + if !self.status.isEmpty { + try visitor.visitSingularStringField(value: self.status, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransactionBalanceTrace, rhs: Protocol_TransactionBalanceTrace) -> Bool { + if lhs.transactionIdentifier != rhs.transactionIdentifier {return false} + if lhs.operation != rhs.operation {return false} + if lhs.type != rhs.type {return false} + if lhs.status != rhs.status {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TransactionBalanceTrace.Operation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_TransactionBalanceTrace.protoMessageName + ".Operation" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "operation_identifier"), + 2: .same(proto: "address"), + 3: .same(proto: "amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.operationIdentifier) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.address) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.amount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.operationIdentifier != 0 { + try visitor.visitSingularInt64Field(value: self.operationIdentifier, fieldNumber: 1) + } + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 2) + } + if self.amount != 0 { + try visitor.visitSingularInt64Field(value: self.amount, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TransactionBalanceTrace.Operation, rhs: Protocol_TransactionBalanceTrace.Operation) -> Bool { + if lhs.operationIdentifier != rhs.operationIdentifier {return false} + if lhs.address != rhs.address {return false} + if lhs.amount != rhs.amount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BlockBalanceTrace: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BlockBalanceTrace" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "block_identifier"), + 2: .same(proto: "timestamp"), + 3: .standard(proto: "transaction_balance_trace"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._blockIdentifier) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.transactionBalanceTrace) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._blockIdentifier { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.timestamp != 0 { + try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 2) + } + if !self.transactionBalanceTrace.isEmpty { + try visitor.visitRepeatedMessageField(value: self.transactionBalanceTrace, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BlockBalanceTrace, rhs: Protocol_BlockBalanceTrace) -> Bool { + if lhs._blockIdentifier != rhs._blockIdentifier {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.transactionBalanceTrace != rhs.transactionBalanceTrace {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BlockBalanceTrace.BlockIdentifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_BlockBalanceTrace.protoMessageName + ".BlockIdentifier" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "hash"), + 2: .same(proto: "number"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.hash) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.number) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.hash.isEmpty { + try visitor.visitSingularBytesField(value: self.hash, fieldNumber: 1) + } + if self.number != 0 { + try visitor.visitSingularInt64Field(value: self.number, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BlockBalanceTrace.BlockIdentifier, rhs: Protocol_BlockBalanceTrace.BlockIdentifier) -> Bool { + if lhs.hash != rhs.hash {return false} + if lhs.number != rhs.number {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AccountTrace: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountTrace" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "balance"), + 99: .same(proto: "placeholder"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.balance) }() + case 99: try { try decoder.decodeSingularInt64Field(value: &self.placeholder) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.balance != 0 { + try visitor.visitSingularInt64Field(value: self.balance, fieldNumber: 1) + } + if self.placeholder != 0 { + try visitor.visitSingularInt64Field(value: self.placeholder, fieldNumber: 99) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountTrace, rhs: Protocol_AccountTrace) -> Bool { + if lhs.balance != rhs.balance {return false} + if lhs.placeholder != rhs.placeholder {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AccountIdentifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountIdentifier" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.address) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.address.isEmpty { + try visitor.visitSingularBytesField(value: self.address, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountIdentifier, rhs: Protocol_AccountIdentifier) -> Bool { + if lhs.address != rhs.address {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AccountBalanceRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountBalanceRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "account_identifier"), + 2: .standard(proto: "block_identifier"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._accountIdentifier) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._blockIdentifier) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._accountIdentifier { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._blockIdentifier { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountBalanceRequest, rhs: Protocol_AccountBalanceRequest) -> Bool { + if lhs._accountIdentifier != rhs._accountIdentifier {return false} + if lhs._blockIdentifier != rhs._blockIdentifier {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_AccountBalanceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AccountBalanceResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "balance"), + 2: .standard(proto: "block_identifier"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.balance) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._blockIdentifier) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.balance != 0 { + try visitor.visitSingularInt64Field(value: self.balance, fieldNumber: 1) + } + try { if let v = self._blockIdentifier { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AccountBalanceResponse, rhs: Protocol_AccountBalanceResponse) -> Bool { + if lhs.balance != rhs.balance {return false} + if lhs._blockIdentifier != rhs._blockIdentifier {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_FreezeBalanceV2Contract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FreezeBalanceV2Contract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "frozen_balance"), + 3: .same(proto: "resource"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.frozenBalance) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.resource) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.frozenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.frozenBalance, fieldNumber: 2) + } + if self.resource != .bandwidth { + try visitor.visitSingularEnumField(value: self.resource, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_FreezeBalanceV2Contract, rhs: Protocol_FreezeBalanceV2Contract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.frozenBalance != rhs.frozenBalance {return false} + if lhs.resource != rhs.resource {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UnfreezeBalanceV2Contract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UnfreezeBalanceV2Contract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "unfreeze_balance"), + 3: .same(proto: "resource"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.unfreezeBalance) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.resource) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.unfreezeBalance != 0 { + try visitor.visitSingularInt64Field(value: self.unfreezeBalance, fieldNumber: 2) + } + if self.resource != .bandwidth { + try visitor.visitSingularEnumField(value: self.resource, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UnfreezeBalanceV2Contract, rhs: Protocol_UnfreezeBalanceV2Contract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unfreezeBalance != rhs.unfreezeBalance {return false} + if lhs.resource != rhs.resource {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_WithdrawExpireUnfreezeContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".WithdrawExpireUnfreezeContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_WithdrawExpireUnfreezeContract, rhs: Protocol_WithdrawExpireUnfreezeContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_DelegateResourceContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DelegateResourceContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "resource"), + 3: .same(proto: "balance"), + 4: .standard(proto: "receiver_address"), + 5: .same(proto: "lock"), + 6: .standard(proto: "lock_period"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.resource) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.balance) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.receiverAddress) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self.lock) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.lockPeriod) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.resource != .bandwidth { + try visitor.visitSingularEnumField(value: self.resource, fieldNumber: 2) + } + if self.balance != 0 { + try visitor.visitSingularInt64Field(value: self.balance, fieldNumber: 3) + } + if !self.receiverAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.receiverAddress, fieldNumber: 4) + } + if self.lock != false { + try visitor.visitSingularBoolField(value: self.lock, fieldNumber: 5) + } + if self.lockPeriod != 0 { + try visitor.visitSingularInt64Field(value: self.lockPeriod, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_DelegateResourceContract, rhs: Protocol_DelegateResourceContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.resource != rhs.resource {return false} + if lhs.balance != rhs.balance {return false} + if lhs.receiverAddress != rhs.receiverAddress {return false} + if lhs.lock != rhs.lock {return false} + if lhs.lockPeriod != rhs.lockPeriod {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UnDelegateResourceContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UnDelegateResourceContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "resource"), + 3: .same(proto: "balance"), + 4: .standard(proto: "receiver_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.resource) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.balance) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.receiverAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.resource != .bandwidth { + try visitor.visitSingularEnumField(value: self.resource, fieldNumber: 2) + } + if self.balance != 0 { + try visitor.visitSingularInt64Field(value: self.balance, fieldNumber: 3) + } + if !self.receiverAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.receiverAddress, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UnDelegateResourceContract, rhs: Protocol_UnDelegateResourceContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.resource != rhs.resource {return false} + if lhs.balance != rhs.balance {return false} + if lhs.receiverAddress != rhs.receiverAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_CancelAllUnfreezeV2Contract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CancelAllUnfreezeV2Contract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_CancelAllUnfreezeV2Contract, rhs: Protocol_CancelAllUnfreezeV2Contract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/common.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/common.pb.swift new file mode 100644 index 000000000..ac7343d06 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/common.pb.swift @@ -0,0 +1,69 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/common.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +enum Protocol_ResourceCode: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case bandwidth // = 0 + case energy // = 1 + case tronPower // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .bandwidth + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .bandwidth + case 1: self = .energy + case 2: self = .tronPower + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .bandwidth: return 0 + case .energy: return 1 + case .tronPower: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_ResourceCode] = [ + .bandwidth, + .energy, + .tronPower, + ] + +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +extension Protocol_ResourceCode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "BANDWIDTH"), + 1: .same(proto: "ENERGY"), + 2: .same(proto: "TRON_POWER"), + ] +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/exchange_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/exchange_contract.pb.swift new file mode 100644 index 000000000..a926212a3 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/exchange_contract.pb.swift @@ -0,0 +1,313 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/exchange_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_ExchangeCreateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var firstTokenID: Data = Data() + + var firstTokenBalance: Int64 = 0 + + var secondTokenID: Data = Data() + + var secondTokenBalance: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ExchangeInjectContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var exchangeID: Int64 = 0 + + var tokenID: Data = Data() + + var quant: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ExchangeWithdrawContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var exchangeID: Int64 = 0 + + var tokenID: Data = Data() + + var quant: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ExchangeTransactionContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var exchangeID: Int64 = 0 + + var tokenID: Data = Data() + + var quant: Int64 = 0 + + var expected: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_ExchangeCreateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ExchangeCreateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "first_token_id"), + 3: .standard(proto: "first_token_balance"), + 4: .standard(proto: "second_token_id"), + 5: .standard(proto: "second_token_balance"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.firstTokenID) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.firstTokenBalance) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.secondTokenID) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.secondTokenBalance) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.firstTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.firstTokenID, fieldNumber: 2) + } + if self.firstTokenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.firstTokenBalance, fieldNumber: 3) + } + if !self.secondTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.secondTokenID, fieldNumber: 4) + } + if self.secondTokenBalance != 0 { + try visitor.visitSingularInt64Field(value: self.secondTokenBalance, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ExchangeCreateContract, rhs: Protocol_ExchangeCreateContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.firstTokenID != rhs.firstTokenID {return false} + if lhs.firstTokenBalance != rhs.firstTokenBalance {return false} + if lhs.secondTokenID != rhs.secondTokenID {return false} + if lhs.secondTokenBalance != rhs.secondTokenBalance {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ExchangeInjectContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ExchangeInjectContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "exchange_id"), + 3: .standard(proto: "token_id"), + 4: .same(proto: "quant"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.exchangeID) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.tokenID) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.quant) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.exchangeID != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeID, fieldNumber: 2) + } + if !self.tokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.tokenID, fieldNumber: 3) + } + if self.quant != 0 { + try visitor.visitSingularInt64Field(value: self.quant, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ExchangeInjectContract, rhs: Protocol_ExchangeInjectContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.exchangeID != rhs.exchangeID {return false} + if lhs.tokenID != rhs.tokenID {return false} + if lhs.quant != rhs.quant {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ExchangeWithdrawContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ExchangeWithdrawContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "exchange_id"), + 3: .standard(proto: "token_id"), + 4: .same(proto: "quant"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.exchangeID) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.tokenID) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.quant) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.exchangeID != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeID, fieldNumber: 2) + } + if !self.tokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.tokenID, fieldNumber: 3) + } + if self.quant != 0 { + try visitor.visitSingularInt64Field(value: self.quant, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ExchangeWithdrawContract, rhs: Protocol_ExchangeWithdrawContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.exchangeID != rhs.exchangeID {return false} + if lhs.tokenID != rhs.tokenID {return false} + if lhs.quant != rhs.quant {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ExchangeTransactionContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ExchangeTransactionContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "exchange_id"), + 3: .standard(proto: "token_id"), + 4: .same(proto: "quant"), + 5: .same(proto: "expected"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.exchangeID) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.tokenID) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.quant) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.expected) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.exchangeID != 0 { + try visitor.visitSingularInt64Field(value: self.exchangeID, fieldNumber: 2) + } + if !self.tokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.tokenID, fieldNumber: 3) + } + if self.quant != 0 { + try visitor.visitSingularInt64Field(value: self.quant, fieldNumber: 4) + } + if self.expected != 0 { + try visitor.visitSingularInt64Field(value: self.expected, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ExchangeTransactionContract, rhs: Protocol_ExchangeTransactionContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.exchangeID != rhs.exchangeID {return false} + if lhs.tokenID != rhs.tokenID {return false} + if lhs.quant != rhs.quant {return false} + if lhs.expected != rhs.expected {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/Contracts.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/market_contract.pb.swift similarity index 57% rename from BlockchainSdk/Blockchains/Tron/protobuf/Contracts.pb.swift rename to BlockchainSdk/Blockchains/Tron/protobuf/contract/market_contract.pb.swift index 0efb52571..af67793f1 100644 --- a/BlockchainSdk/Blockchains/Tron/protobuf/Contracts.pb.swift +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/market_contract.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: Contracts.proto +// Source: core/contract/market_contract.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ @@ -20,59 +20,53 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP typealias Version = _2 } -struct Protocol_TransferContract { +struct Protocol_MarketSellAssetContract: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var ownerAddress: Data = Data() - var toAddress: Data = Data() + var sellTokenID: Data = Data() - var amount: Int64 = 0 + var sellTokenQuantity: Int64 = 0 + + var buyTokenID: Data = Data() + + /// min to receive + var buyTokenQuantity: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -struct Protocol_TriggerSmartContract { +struct Protocol_MarketCancelOrderContract: @unchecked Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var ownerAddress: Data = Data() - var contractAddress: Data = Data() - - var callValue: Int64 = 0 - - var data: Data = Data() - - var callTokenValue: Int64 = 0 - - var tokenID: Int64 = 0 + var orderID: Data = Data() var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } -#if swift(>=5.5) && canImport(_Concurrency) -extension Protocol_TransferContract: @unchecked Sendable {} -extension Protocol_TriggerSmartContract: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "protocol" -extension Protocol_TransferContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TransferContract" +extension Protocol_MarketSellAssetContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketSellAssetContract" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "owner_address"), - 2: .standard(proto: "to_address"), - 3: .same(proto: "amount"), + 2: .standard(proto: "sell_token_id"), + 3: .standard(proto: "sell_token_quantity"), + 4: .standard(proto: "buy_token_id"), + 5: .standard(proto: "buy_token_quantity"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -82,8 +76,10 @@ extension Protocol_TransferContract: SwiftProtobuf.Message, SwiftProtobuf._Messa // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.toAddress) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.amount) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.sellTokenID) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.sellTokenQuantity) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.buyTokenID) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.buyTokenQuantity) }() default: break } } @@ -93,33 +89,37 @@ extension Protocol_TransferContract: SwiftProtobuf.Message, SwiftProtobuf._Messa if !self.ownerAddress.isEmpty { try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) } - if !self.toAddress.isEmpty { - try visitor.visitSingularBytesField(value: self.toAddress, fieldNumber: 2) + if !self.sellTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.sellTokenID, fieldNumber: 2) } - if self.amount != 0 { - try visitor.visitSingularInt64Field(value: self.amount, fieldNumber: 3) + if self.sellTokenQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.sellTokenQuantity, fieldNumber: 3) + } + if !self.buyTokenID.isEmpty { + try visitor.visitSingularBytesField(value: self.buyTokenID, fieldNumber: 4) + } + if self.buyTokenQuantity != 0 { + try visitor.visitSingularInt64Field(value: self.buyTokenQuantity, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_TransferContract, rhs: Protocol_TransferContract) -> Bool { + static func ==(lhs: Protocol_MarketSellAssetContract, rhs: Protocol_MarketSellAssetContract) -> Bool { if lhs.ownerAddress != rhs.ownerAddress {return false} - if lhs.toAddress != rhs.toAddress {return false} - if lhs.amount != rhs.amount {return false} + if lhs.sellTokenID != rhs.sellTokenID {return false} + if lhs.sellTokenQuantity != rhs.sellTokenQuantity {return false} + if lhs.buyTokenID != rhs.buyTokenID {return false} + if lhs.buyTokenQuantity != rhs.buyTokenQuantity {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Protocol_TriggerSmartContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TriggerSmartContract" +extension Protocol_MarketCancelOrderContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MarketCancelOrderContract" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "owner_address"), - 2: .standard(proto: "contract_address"), - 3: .standard(proto: "call_value"), - 4: .same(proto: "data"), - 5: .standard(proto: "call_token_value"), - 6: .standard(proto: "token_id"), + 2: .standard(proto: "order_id"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -129,11 +129,7 @@ extension Protocol_TriggerSmartContract: SwiftProtobuf.Message, SwiftProtobuf._M // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.contractAddress) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.callValue) }() - case 4: try { try decoder.decodeSingularBytesField(value: &self.data) }() - case 5: try { try decoder.decodeSingularInt64Field(value: &self.callTokenValue) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &self.tokenID) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.orderID) }() default: break } } @@ -143,31 +139,15 @@ extension Protocol_TriggerSmartContract: SwiftProtobuf.Message, SwiftProtobuf._M if !self.ownerAddress.isEmpty { try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) } - if !self.contractAddress.isEmpty { - try visitor.visitSingularBytesField(value: self.contractAddress, fieldNumber: 2) - } - if self.callValue != 0 { - try visitor.visitSingularInt64Field(value: self.callValue, fieldNumber: 3) - } - if !self.data.isEmpty { - try visitor.visitSingularBytesField(value: self.data, fieldNumber: 4) - } - if self.callTokenValue != 0 { - try visitor.visitSingularInt64Field(value: self.callTokenValue, fieldNumber: 5) - } - if self.tokenID != 0 { - try visitor.visitSingularInt64Field(value: self.tokenID, fieldNumber: 6) + if !self.orderID.isEmpty { + try visitor.visitSingularBytesField(value: self.orderID, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } - static func ==(lhs: Protocol_TriggerSmartContract, rhs: Protocol_TriggerSmartContract) -> Bool { + static func ==(lhs: Protocol_MarketCancelOrderContract, rhs: Protocol_MarketCancelOrderContract) -> Bool { if lhs.ownerAddress != rhs.ownerAddress {return false} - if lhs.contractAddress != rhs.contractAddress {return false} - if lhs.callValue != rhs.callValue {return false} - if lhs.data != rhs.data {return false} - if lhs.callTokenValue != rhs.callTokenValue {return false} - if lhs.tokenID != rhs.tokenID {return false} + if lhs.orderID != rhs.orderID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/proposal_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/proposal_contract.pb.swift new file mode 100644 index 000000000..c281ef17a --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/proposal_contract.pb.swift @@ -0,0 +1,190 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/proposal_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_ProposalApproveContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var proposalID: Int64 = 0 + + /// add or remove approval + var isAddApproval: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ProposalCreateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var parameters: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ProposalDeleteContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var proposalID: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_ProposalApproveContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProposalApproveContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "proposal_id"), + 3: .standard(proto: "is_add_approval"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.proposalID) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.isAddApproval) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.proposalID != 0 { + try visitor.visitSingularInt64Field(value: self.proposalID, fieldNumber: 2) + } + if self.isAddApproval != false { + try visitor.visitSingularBoolField(value: self.isAddApproval, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ProposalApproveContract, rhs: Protocol_ProposalApproveContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.proposalID != rhs.proposalID {return false} + if lhs.isAddApproval != rhs.isAddApproval {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ProposalCreateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProposalCreateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "parameters"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.parameters) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.parameters.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.parameters, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ProposalCreateContract, rhs: Protocol_ProposalCreateContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.parameters != rhs.parameters {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ProposalDeleteContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProposalDeleteContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "proposal_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.proposalID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.proposalID != 0 { + try visitor.visitSingularInt64Field(value: self.proposalID, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ProposalDeleteContract, rhs: Protocol_ProposalDeleteContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.proposalID != rhs.proposalID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/shield_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/shield_contract.pb.swift new file mode 100644 index 000000000..f40df14b8 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/shield_contract.pb.swift @@ -0,0 +1,792 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/shield_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_AuthenticationPath: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var value: [Bool] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_MerklePath: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var authenticationPaths: [Protocol_AuthenticationPath] = [] + + var index: [Bool] = [] + + var rt: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_OutputPoint: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var hash: Data = Data() + + var index: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_OutputPointInfo: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var outPoints: [Protocol_OutputPoint] = [] + + var blockNum: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_PedersenHash: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var content: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_IncrementalMerkleTree: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var left: Protocol_PedersenHash { + get {return _left ?? Protocol_PedersenHash()} + set {_left = newValue} + } + /// Returns true if `left` has been explicitly set. + var hasLeft: Bool {return self._left != nil} + /// Clears the value of `left`. Subsequent reads from it will return its default value. + mutating func clearLeft() {self._left = nil} + + var right: Protocol_PedersenHash { + get {return _right ?? Protocol_PedersenHash()} + set {_right = newValue} + } + /// Returns true if `right` has been explicitly set. + var hasRight: Bool {return self._right != nil} + /// Clears the value of `right`. Subsequent reads from it will return its default value. + mutating func clearRight() {self._right = nil} + + var parents: [Protocol_PedersenHash] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _left: Protocol_PedersenHash? = nil + fileprivate var _right: Protocol_PedersenHash? = nil +} + +struct Protocol_IncrementalMerkleVoucher: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var tree: Protocol_IncrementalMerkleTree { + get {return _tree ?? Protocol_IncrementalMerkleTree()} + set {_tree = newValue} + } + /// Returns true if `tree` has been explicitly set. + var hasTree: Bool {return self._tree != nil} + /// Clears the value of `tree`. Subsequent reads from it will return its default value. + mutating func clearTree() {self._tree = nil} + + var filled: [Protocol_PedersenHash] = [] + + var cursor: Protocol_IncrementalMerkleTree { + get {return _cursor ?? Protocol_IncrementalMerkleTree()} + set {_cursor = newValue} + } + /// Returns true if `cursor` has been explicitly set. + var hasCursor: Bool {return self._cursor != nil} + /// Clears the value of `cursor`. Subsequent reads from it will return its default value. + mutating func clearCursor() {self._cursor = nil} + + var cursorDepth: Int64 = 0 + + var rt: Data = Data() + + var outputPoint: Protocol_OutputPoint { + get {return _outputPoint ?? Protocol_OutputPoint()} + set {_outputPoint = newValue} + } + /// Returns true if `outputPoint` has been explicitly set. + var hasOutputPoint: Bool {return self._outputPoint != nil} + /// Clears the value of `outputPoint`. Subsequent reads from it will return its default value. + mutating func clearOutputPoint() {self._outputPoint = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _tree: Protocol_IncrementalMerkleTree? = nil + fileprivate var _cursor: Protocol_IncrementalMerkleTree? = nil + fileprivate var _outputPoint: Protocol_OutputPoint? = nil +} + +struct Protocol_IncrementalMerkleVoucherInfo: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var vouchers: [Protocol_IncrementalMerkleVoucher] = [] + + var paths: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_SpendDescription: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var valueCommitment: Data = Data() + + /// merkle root + var anchor: Data = Data() + + /// used for check double spend + var nullifier: Data = Data() + + /// used for check spend authority signature + var rk: Data = Data() + + var zkproof: Data = Data() + + var spendAuthoritySignature: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ReceiveDescription: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var valueCommitment: Data = Data() + + var noteCommitment: Data = Data() + + /// for Encryption + var epk: Data = Data() + + /// Encryption for incoming, decrypt it with ivk + var cEnc: Data = Data() + + /// Encryption for audit, decrypt it with ovk + var cOut: Data = Data() + + var zkproof: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ShieldedTransferContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// transparent address + var transparentFromAddress: Data = Data() + + var fromAmount: Int64 = 0 + + var spendDescription: [Protocol_SpendDescription] = [] + + var receiveDescription: [Protocol_ReceiveDescription] = [] + + var bindingSignature: Data = Data() + + /// transparent address + var transparentToAddress: Data = Data() + + /// the amount to transparent to_address + var toAmount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_AuthenticationPath: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AuthenticationPath" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedBoolField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.value.isEmpty { + try visitor.visitPackedBoolField(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_AuthenticationPath, rhs: Protocol_AuthenticationPath) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_MerklePath: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MerklePath" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "authentication_paths"), + 2: .same(proto: "index"), + 3: .same(proto: "rt"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.authenticationPaths) }() + case 2: try { try decoder.decodeRepeatedBoolField(value: &self.index) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.rt) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.authenticationPaths.isEmpty { + try visitor.visitRepeatedMessageField(value: self.authenticationPaths, fieldNumber: 1) + } + if !self.index.isEmpty { + try visitor.visitPackedBoolField(value: self.index, fieldNumber: 2) + } + if !self.rt.isEmpty { + try visitor.visitSingularBytesField(value: self.rt, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_MerklePath, rhs: Protocol_MerklePath) -> Bool { + if lhs.authenticationPaths != rhs.authenticationPaths {return false} + if lhs.index != rhs.index {return false} + if lhs.rt != rhs.rt {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_OutputPoint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OutputPoint" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "hash"), + 2: .same(proto: "index"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.hash) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.index) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.hash.isEmpty { + try visitor.visitSingularBytesField(value: self.hash, fieldNumber: 1) + } + if self.index != 0 { + try visitor.visitSingularInt32Field(value: self.index, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_OutputPoint, rhs: Protocol_OutputPoint) -> Bool { + if lhs.hash != rhs.hash {return false} + if lhs.index != rhs.index {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_OutputPointInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OutputPointInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "out_points"), + 2: .standard(proto: "block_num"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.outPoints) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.blockNum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.outPoints.isEmpty { + try visitor.visitRepeatedMessageField(value: self.outPoints, fieldNumber: 1) + } + if self.blockNum != 0 { + try visitor.visitSingularInt32Field(value: self.blockNum, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_OutputPointInfo, rhs: Protocol_OutputPointInfo) -> Bool { + if lhs.outPoints != rhs.outPoints {return false} + if lhs.blockNum != rhs.blockNum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_PedersenHash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PedersenHash" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "content"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.content) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.content.isEmpty { + try visitor.visitSingularBytesField(value: self.content, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_PedersenHash, rhs: Protocol_PedersenHash) -> Bool { + if lhs.content != rhs.content {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_IncrementalMerkleTree: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".IncrementalMerkleTree" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "left"), + 2: .same(proto: "right"), + 3: .same(proto: "parents"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._left) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._right) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.parents) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._left { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._right { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.parents.isEmpty { + try visitor.visitRepeatedMessageField(value: self.parents, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_IncrementalMerkleTree, rhs: Protocol_IncrementalMerkleTree) -> Bool { + if lhs._left != rhs._left {return false} + if lhs._right != rhs._right {return false} + if lhs.parents != rhs.parents {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_IncrementalMerkleVoucher: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".IncrementalMerkleVoucher" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "tree"), + 2: .same(proto: "filled"), + 3: .same(proto: "cursor"), + 4: .standard(proto: "cursor_depth"), + 5: .same(proto: "rt"), + 10: .standard(proto: "output_point"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._tree) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.filled) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._cursor) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.cursorDepth) }() + case 5: try { try decoder.decodeSingularBytesField(value: &self.rt) }() + case 10: try { try decoder.decodeSingularMessageField(value: &self._outputPoint) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._tree { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.filled.isEmpty { + try visitor.visitRepeatedMessageField(value: self.filled, fieldNumber: 2) + } + try { if let v = self._cursor { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if self.cursorDepth != 0 { + try visitor.visitSingularInt64Field(value: self.cursorDepth, fieldNumber: 4) + } + if !self.rt.isEmpty { + try visitor.visitSingularBytesField(value: self.rt, fieldNumber: 5) + } + try { if let v = self._outputPoint { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_IncrementalMerkleVoucher, rhs: Protocol_IncrementalMerkleVoucher) -> Bool { + if lhs._tree != rhs._tree {return false} + if lhs.filled != rhs.filled {return false} + if lhs._cursor != rhs._cursor {return false} + if lhs.cursorDepth != rhs.cursorDepth {return false} + if lhs.rt != rhs.rt {return false} + if lhs._outputPoint != rhs._outputPoint {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_IncrementalMerkleVoucherInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".IncrementalMerkleVoucherInfo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "vouchers"), + 2: .same(proto: "paths"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.vouchers) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.paths) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.vouchers.isEmpty { + try visitor.visitRepeatedMessageField(value: self.vouchers, fieldNumber: 1) + } + if !self.paths.isEmpty { + try visitor.visitRepeatedBytesField(value: self.paths, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_IncrementalMerkleVoucherInfo, rhs: Protocol_IncrementalMerkleVoucherInfo) -> Bool { + if lhs.vouchers != rhs.vouchers {return false} + if lhs.paths != rhs.paths {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SpendDescription: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SpendDescription" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "value_commitment"), + 2: .same(proto: "anchor"), + 3: .same(proto: "nullifier"), + 4: .same(proto: "rk"), + 5: .same(proto: "zkproof"), + 6: .standard(proto: "spend_authority_signature"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.valueCommitment) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.anchor) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.nullifier) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.rk) }() + case 5: try { try decoder.decodeSingularBytesField(value: &self.zkproof) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self.spendAuthoritySignature) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.valueCommitment.isEmpty { + try visitor.visitSingularBytesField(value: self.valueCommitment, fieldNumber: 1) + } + if !self.anchor.isEmpty { + try visitor.visitSingularBytesField(value: self.anchor, fieldNumber: 2) + } + if !self.nullifier.isEmpty { + try visitor.visitSingularBytesField(value: self.nullifier, fieldNumber: 3) + } + if !self.rk.isEmpty { + try visitor.visitSingularBytesField(value: self.rk, fieldNumber: 4) + } + if !self.zkproof.isEmpty { + try visitor.visitSingularBytesField(value: self.zkproof, fieldNumber: 5) + } + if !self.spendAuthoritySignature.isEmpty { + try visitor.visitSingularBytesField(value: self.spendAuthoritySignature, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SpendDescription, rhs: Protocol_SpendDescription) -> Bool { + if lhs.valueCommitment != rhs.valueCommitment {return false} + if lhs.anchor != rhs.anchor {return false} + if lhs.nullifier != rhs.nullifier {return false} + if lhs.rk != rhs.rk {return false} + if lhs.zkproof != rhs.zkproof {return false} + if lhs.spendAuthoritySignature != rhs.spendAuthoritySignature {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ReceiveDescription: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ReceiveDescription" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "value_commitment"), + 2: .standard(proto: "note_commitment"), + 3: .same(proto: "epk"), + 4: .standard(proto: "c_enc"), + 5: .standard(proto: "c_out"), + 6: .same(proto: "zkproof"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.valueCommitment) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.noteCommitment) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.epk) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.cEnc) }() + case 5: try { try decoder.decodeSingularBytesField(value: &self.cOut) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self.zkproof) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.valueCommitment.isEmpty { + try visitor.visitSingularBytesField(value: self.valueCommitment, fieldNumber: 1) + } + if !self.noteCommitment.isEmpty { + try visitor.visitSingularBytesField(value: self.noteCommitment, fieldNumber: 2) + } + if !self.epk.isEmpty { + try visitor.visitSingularBytesField(value: self.epk, fieldNumber: 3) + } + if !self.cEnc.isEmpty { + try visitor.visitSingularBytesField(value: self.cEnc, fieldNumber: 4) + } + if !self.cOut.isEmpty { + try visitor.visitSingularBytesField(value: self.cOut, fieldNumber: 5) + } + if !self.zkproof.isEmpty { + try visitor.visitSingularBytesField(value: self.zkproof, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ReceiveDescription, rhs: Protocol_ReceiveDescription) -> Bool { + if lhs.valueCommitment != rhs.valueCommitment {return false} + if lhs.noteCommitment != rhs.noteCommitment {return false} + if lhs.epk != rhs.epk {return false} + if lhs.cEnc != rhs.cEnc {return false} + if lhs.cOut != rhs.cOut {return false} + if lhs.zkproof != rhs.zkproof {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ShieldedTransferContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ShieldedTransferContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "transparent_from_address"), + 2: .standard(proto: "from_amount"), + 3: .standard(proto: "spend_description"), + 4: .standard(proto: "receive_description"), + 5: .standard(proto: "binding_signature"), + 6: .standard(proto: "transparent_to_address"), + 7: .standard(proto: "to_amount"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.transparentFromAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.fromAmount) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.spendDescription) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.receiveDescription) }() + case 5: try { try decoder.decodeSingularBytesField(value: &self.bindingSignature) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self.transparentToAddress) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.toAmount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.transparentFromAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.transparentFromAddress, fieldNumber: 1) + } + if self.fromAmount != 0 { + try visitor.visitSingularInt64Field(value: self.fromAmount, fieldNumber: 2) + } + if !self.spendDescription.isEmpty { + try visitor.visitRepeatedMessageField(value: self.spendDescription, fieldNumber: 3) + } + if !self.receiveDescription.isEmpty { + try visitor.visitRepeatedMessageField(value: self.receiveDescription, fieldNumber: 4) + } + if !self.bindingSignature.isEmpty { + try visitor.visitSingularBytesField(value: self.bindingSignature, fieldNumber: 5) + } + if !self.transparentToAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.transparentToAddress, fieldNumber: 6) + } + if self.toAmount != 0 { + try visitor.visitSingularInt64Field(value: self.toAmount, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ShieldedTransferContract, rhs: Protocol_ShieldedTransferContract) -> Bool { + if lhs.transparentFromAddress != rhs.transparentFromAddress {return false} + if lhs.fromAmount != rhs.fromAmount {return false} + if lhs.spendDescription != rhs.spendDescription {return false} + if lhs.receiveDescription != rhs.receiveDescription {return false} + if lhs.bindingSignature != rhs.bindingSignature {return false} + if lhs.transparentToAddress != rhs.transparentToAddress {return false} + if lhs.toAmount != rhs.toAmount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/smart_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/smart_contract.pb.swift new file mode 100644 index 000000000..ff251975b --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/smart_contract.pb.swift @@ -0,0 +1,967 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/smart_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_SmartContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var originAddress: Data = Data() + + var contractAddress: Data = Data() + + var abi: Protocol_SmartContract.ABI { + get {return _abi ?? Protocol_SmartContract.ABI()} + set {_abi = newValue} + } + /// Returns true if `abi` has been explicitly set. + var hasAbi: Bool {return self._abi != nil} + /// Clears the value of `abi`. Subsequent reads from it will return its default value. + mutating func clearAbi() {self._abi = nil} + + var bytecode: Data = Data() + + var callValue: Int64 = 0 + + var consumeUserResourcePercent: Int64 = 0 + + var name: String = String() + + var originEnergyLimit: Int64 = 0 + + var codeHash: Data = Data() + + var trxHash: Data = Data() + + var version: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct ABI: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var entrys: [Protocol_SmartContract.ABI.Entry] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Entry: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var anonymous: Bool = false + + var constant: Bool = false + + var name: String = String() + + var inputs: [Protocol_SmartContract.ABI.Entry.Param] = [] + + var outputs: [Protocol_SmartContract.ABI.Entry.Param] = [] + + var type: Protocol_SmartContract.ABI.Entry.EntryType = .unknownEntryType + + var payable: Bool = false + + var stateMutability: Protocol_SmartContract.ABI.Entry.StateMutabilityType = .unknownMutabilityType + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum EntryType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case unknownEntryType // = 0 + case constructor // = 1 + case function // = 2 + case event // = 3 + case fallback // = 4 + case receive // = 5 + case error // = 6 + case UNRECOGNIZED(Int) + + init() { + self = .unknownEntryType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownEntryType + case 1: self = .constructor + case 2: self = .function + case 3: self = .event + case 4: self = .fallback + case 5: self = .receive + case 6: self = .error + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknownEntryType: return 0 + case .constructor: return 1 + case .function: return 2 + case .event: return 3 + case .fallback: return 4 + case .receive: return 5 + case .error: return 6 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_SmartContract.ABI.Entry.EntryType] = [ + .unknownEntryType, + .constructor, + .function, + .event, + .fallback, + .receive, + .error, + ] + + } + + enum StateMutabilityType: SwiftProtobuf.Enum, Swift.CaseIterable { + typealias RawValue = Int + case unknownMutabilityType // = 0 + case pure // = 1 + case view // = 2 + case nonpayable // = 3 + case payable // = 4 + case UNRECOGNIZED(Int) + + init() { + self = .unknownMutabilityType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownMutabilityType + case 1: self = .pure + case 2: self = .view + case 3: self = .nonpayable + case 4: self = .payable + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknownMutabilityType: return 0 + case .pure: return 1 + case .view: return 2 + case .nonpayable: return 3 + case .payable: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Protocol_SmartContract.ABI.Entry.StateMutabilityType] = [ + .unknownMutabilityType, + .pure, + .view, + .nonpayable, + .payable, + ] + + } + + struct Param: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var indexed: Bool = false + + var name: String = String() + + /// SolidityType type = 3; + var type: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + } + + init() {} + } + + init() {} + + fileprivate var _abi: Protocol_SmartContract.ABI? = nil +} + +struct Protocol_ContractState: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var energyUsage: Int64 = 0 + + var energyFactor: Int64 = 0 + + var updateCycle: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_CreateSmartContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var newContract: Protocol_SmartContract { + get {return _newContract ?? Protocol_SmartContract()} + set {_newContract = newValue} + } + /// Returns true if `newContract` has been explicitly set. + var hasNewContract: Bool {return self._newContract != nil} + /// Clears the value of `newContract`. Subsequent reads from it will return its default value. + mutating func clearNewContract() {self._newContract = nil} + + var callTokenValue: Int64 = 0 + + var tokenID: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _newContract: Protocol_SmartContract? = nil +} + +struct Protocol_TriggerSmartContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var contractAddress: Data = Data() + + var callValue: Int64 = 0 + + var data: Data = Data() + + var callTokenValue: Int64 = 0 + + var tokenID: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_ClearABIContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var contractAddress: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UpdateSettingContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var contractAddress: Data = Data() + + var consumeUserResourcePercent: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UpdateEnergyLimitContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var contractAddress: Data = Data() + + var originEnergyLimit: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_SmartContractDataWrapper: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var smartContract: Protocol_SmartContract { + get {return _smartContract ?? Protocol_SmartContract()} + set {_smartContract = newValue} + } + /// Returns true if `smartContract` has been explicitly set. + var hasSmartContract: Bool {return self._smartContract != nil} + /// Clears the value of `smartContract`. Subsequent reads from it will return its default value. + mutating func clearSmartContract() {self._smartContract = nil} + + var runtimecode: Data = Data() + + var contractState: Protocol_ContractState { + get {return _contractState ?? Protocol_ContractState()} + set {_contractState = newValue} + } + /// Returns true if `contractState` has been explicitly set. + var hasContractState: Bool {return self._contractState != nil} + /// Clears the value of `contractState`. Subsequent reads from it will return its default value. + mutating func clearContractState() {self._contractState = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _smartContract: Protocol_SmartContract? = nil + fileprivate var _contractState: Protocol_ContractState? = nil +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_SmartContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SmartContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "origin_address"), + 2: .standard(proto: "contract_address"), + 3: .same(proto: "abi"), + 4: .same(proto: "bytecode"), + 5: .standard(proto: "call_value"), + 6: .standard(proto: "consume_user_resource_percent"), + 7: .same(proto: "name"), + 8: .standard(proto: "origin_energy_limit"), + 9: .standard(proto: "code_hash"), + 10: .standard(proto: "trx_hash"), + 11: .same(proto: "version"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.originAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.contractAddress) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._abi) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.bytecode) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.callValue) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.consumeUserResourcePercent) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.originEnergyLimit) }() + case 9: try { try decoder.decodeSingularBytesField(value: &self.codeHash) }() + case 10: try { try decoder.decodeSingularBytesField(value: &self.trxHash) }() + case 11: try { try decoder.decodeSingularInt32Field(value: &self.version) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.originAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.originAddress, fieldNumber: 1) + } + if !self.contractAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.contractAddress, fieldNumber: 2) + } + try { if let v = self._abi { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.bytecode.isEmpty { + try visitor.visitSingularBytesField(value: self.bytecode, fieldNumber: 4) + } + if self.callValue != 0 { + try visitor.visitSingularInt64Field(value: self.callValue, fieldNumber: 5) + } + if self.consumeUserResourcePercent != 0 { + try visitor.visitSingularInt64Field(value: self.consumeUserResourcePercent, fieldNumber: 6) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 7) + } + if self.originEnergyLimit != 0 { + try visitor.visitSingularInt64Field(value: self.originEnergyLimit, fieldNumber: 8) + } + if !self.codeHash.isEmpty { + try visitor.visitSingularBytesField(value: self.codeHash, fieldNumber: 9) + } + if !self.trxHash.isEmpty { + try visitor.visitSingularBytesField(value: self.trxHash, fieldNumber: 10) + } + if self.version != 0 { + try visitor.visitSingularInt32Field(value: self.version, fieldNumber: 11) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SmartContract, rhs: Protocol_SmartContract) -> Bool { + if lhs.originAddress != rhs.originAddress {return false} + if lhs.contractAddress != rhs.contractAddress {return false} + if lhs._abi != rhs._abi {return false} + if lhs.bytecode != rhs.bytecode {return false} + if lhs.callValue != rhs.callValue {return false} + if lhs.consumeUserResourcePercent != rhs.consumeUserResourcePercent {return false} + if lhs.name != rhs.name {return false} + if lhs.originEnergyLimit != rhs.originEnergyLimit {return false} + if lhs.codeHash != rhs.codeHash {return false} + if lhs.trxHash != rhs.trxHash {return false} + if lhs.version != rhs.version {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SmartContract.ABI: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_SmartContract.protoMessageName + ".ABI" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "entrys"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.entrys) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.entrys.isEmpty { + try visitor.visitRepeatedMessageField(value: self.entrys, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SmartContract.ABI, rhs: Protocol_SmartContract.ABI) -> Bool { + if lhs.entrys != rhs.entrys {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SmartContract.ABI.Entry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_SmartContract.ABI.protoMessageName + ".Entry" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "anonymous"), + 2: .same(proto: "constant"), + 3: .same(proto: "name"), + 4: .same(proto: "inputs"), + 5: .same(proto: "outputs"), + 6: .same(proto: "type"), + 7: .same(proto: "payable"), + 8: .same(proto: "stateMutability"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.anonymous) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.constant) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.inputs) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.outputs) }() + case 6: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 7: try { try decoder.decodeSingularBoolField(value: &self.payable) }() + case 8: try { try decoder.decodeSingularEnumField(value: &self.stateMutability) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.anonymous != false { + try visitor.visitSingularBoolField(value: self.anonymous, fieldNumber: 1) + } + if self.constant != false { + try visitor.visitSingularBoolField(value: self.constant, fieldNumber: 2) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) + } + if !self.inputs.isEmpty { + try visitor.visitRepeatedMessageField(value: self.inputs, fieldNumber: 4) + } + if !self.outputs.isEmpty { + try visitor.visitRepeatedMessageField(value: self.outputs, fieldNumber: 5) + } + if self.type != .unknownEntryType { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 6) + } + if self.payable != false { + try visitor.visitSingularBoolField(value: self.payable, fieldNumber: 7) + } + if self.stateMutability != .unknownMutabilityType { + try visitor.visitSingularEnumField(value: self.stateMutability, fieldNumber: 8) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SmartContract.ABI.Entry, rhs: Protocol_SmartContract.ABI.Entry) -> Bool { + if lhs.anonymous != rhs.anonymous {return false} + if lhs.constant != rhs.constant {return false} + if lhs.name != rhs.name {return false} + if lhs.inputs != rhs.inputs {return false} + if lhs.outputs != rhs.outputs {return false} + if lhs.type != rhs.type {return false} + if lhs.payable != rhs.payable {return false} + if lhs.stateMutability != rhs.stateMutability {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SmartContract.ABI.Entry.EntryType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UnknownEntryType"), + 1: .same(proto: "Constructor"), + 2: .same(proto: "Function"), + 3: .same(proto: "Event"), + 4: .same(proto: "Fallback"), + 5: .same(proto: "Receive"), + 6: .same(proto: "Error"), + ] +} + +extension Protocol_SmartContract.ABI.Entry.StateMutabilityType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UnknownMutabilityType"), + 1: .same(proto: "Pure"), + 2: .same(proto: "View"), + 3: .same(proto: "Nonpayable"), + 4: .same(proto: "Payable"), + ] +} + +extension Protocol_SmartContract.ABI.Entry.Param: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_SmartContract.ABI.Entry.protoMessageName + ".Param" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "indexed"), + 2: .same(proto: "name"), + 3: .same(proto: "type"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.indexed) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.type) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.indexed != false { + try visitor.visitSingularBoolField(value: self.indexed, fieldNumber: 1) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) + } + if !self.type.isEmpty { + try visitor.visitSingularStringField(value: self.type, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SmartContract.ABI.Entry.Param, rhs: Protocol_SmartContract.ABI.Entry.Param) -> Bool { + if lhs.indexed != rhs.indexed {return false} + if lhs.name != rhs.name {return false} + if lhs.type != rhs.type {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ContractState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ContractState" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "energy_usage"), + 2: .standard(proto: "energy_factor"), + 3: .standard(proto: "update_cycle"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.energyUsage) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.energyFactor) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.updateCycle) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.energyUsage != 0 { + try visitor.visitSingularInt64Field(value: self.energyUsage, fieldNumber: 1) + } + if self.energyFactor != 0 { + try visitor.visitSingularInt64Field(value: self.energyFactor, fieldNumber: 2) + } + if self.updateCycle != 0 { + try visitor.visitSingularInt64Field(value: self.updateCycle, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ContractState, rhs: Protocol_ContractState) -> Bool { + if lhs.energyUsage != rhs.energyUsage {return false} + if lhs.energyFactor != rhs.energyFactor {return false} + if lhs.updateCycle != rhs.updateCycle {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_CreateSmartContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CreateSmartContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "new_contract"), + 3: .standard(proto: "call_token_value"), + 4: .standard(proto: "token_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._newContract) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.callTokenValue) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self.tokenID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + try { if let v = self._newContract { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if self.callTokenValue != 0 { + try visitor.visitSingularInt64Field(value: self.callTokenValue, fieldNumber: 3) + } + if self.tokenID != 0 { + try visitor.visitSingularInt64Field(value: self.tokenID, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_CreateSmartContract, rhs: Protocol_CreateSmartContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs._newContract != rhs._newContract {return false} + if lhs.callTokenValue != rhs.callTokenValue {return false} + if lhs.tokenID != rhs.tokenID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_TriggerSmartContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TriggerSmartContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "contract_address"), + 3: .standard(proto: "call_value"), + 4: .same(proto: "data"), + 5: .standard(proto: "call_token_value"), + 6: .standard(proto: "token_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.contractAddress) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.callValue) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self.data) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self.callTokenValue) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.tokenID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.contractAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.contractAddress, fieldNumber: 2) + } + if self.callValue != 0 { + try visitor.visitSingularInt64Field(value: self.callValue, fieldNumber: 3) + } + if !self.data.isEmpty { + try visitor.visitSingularBytesField(value: self.data, fieldNumber: 4) + } + if self.callTokenValue != 0 { + try visitor.visitSingularInt64Field(value: self.callTokenValue, fieldNumber: 5) + } + if self.tokenID != 0 { + try visitor.visitSingularInt64Field(value: self.tokenID, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_TriggerSmartContract, rhs: Protocol_TriggerSmartContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.contractAddress != rhs.contractAddress {return false} + if lhs.callValue != rhs.callValue {return false} + if lhs.data != rhs.data {return false} + if lhs.callTokenValue != rhs.callTokenValue {return false} + if lhs.tokenID != rhs.tokenID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_ClearABIContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ClearABIContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "contract_address"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.contractAddress) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.contractAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.contractAddress, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_ClearABIContract, rhs: Protocol_ClearABIContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.contractAddress != rhs.contractAddress {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UpdateSettingContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UpdateSettingContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "contract_address"), + 3: .standard(proto: "consume_user_resource_percent"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.contractAddress) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.consumeUserResourcePercent) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.contractAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.contractAddress, fieldNumber: 2) + } + if self.consumeUserResourcePercent != 0 { + try visitor.visitSingularInt64Field(value: self.consumeUserResourcePercent, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UpdateSettingContract, rhs: Protocol_UpdateSettingContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.contractAddress != rhs.contractAddress {return false} + if lhs.consumeUserResourcePercent != rhs.consumeUserResourcePercent {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UpdateEnergyLimitContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UpdateEnergyLimitContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "contract_address"), + 3: .standard(proto: "origin_energy_limit"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.contractAddress) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.originEnergyLimit) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.contractAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.contractAddress, fieldNumber: 2) + } + if self.originEnergyLimit != 0 { + try visitor.visitSingularInt64Field(value: self.originEnergyLimit, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UpdateEnergyLimitContract, rhs: Protocol_UpdateEnergyLimitContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.contractAddress != rhs.contractAddress {return false} + if lhs.originEnergyLimit != rhs.originEnergyLimit {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SmartContractDataWrapper: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SmartContractDataWrapper" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "smart_contract"), + 2: .same(proto: "runtimecode"), + 3: .standard(proto: "contract_state"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._smartContract) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.runtimecode) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._contractState) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._smartContract { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.runtimecode.isEmpty { + try visitor.visitSingularBytesField(value: self.runtimecode, fieldNumber: 2) + } + try { if let v = self._contractState { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SmartContractDataWrapper, rhs: Protocol_SmartContractDataWrapper) -> Bool { + if lhs._smartContract != rhs._smartContract {return false} + if lhs.runtimecode != rhs.runtimecode {return false} + if lhs._contractState != rhs._contractState {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/storage_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/storage_contract.pb.swift new file mode 100644 index 000000000..f2de4d84e --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/storage_contract.pb.swift @@ -0,0 +1,236 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/storage_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_BuyStorageBytesContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + /// storage bytes for buy + var bytes: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_BuyStorageContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + /// trx quantity for buy storage (sun) + var quant: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_SellStorageContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var storageBytes: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_UpdateBrokerageContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + /// 1 mean 1% + var brokerage: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_BuyStorageBytesContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BuyStorageBytesContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "bytes"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.bytes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.bytes != 0 { + try visitor.visitSingularInt64Field(value: self.bytes, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BuyStorageBytesContract, rhs: Protocol_BuyStorageBytesContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.bytes != rhs.bytes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_BuyStorageContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BuyStorageContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "quant"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.quant) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.quant != 0 { + try visitor.visitSingularInt64Field(value: self.quant, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_BuyStorageContract, rhs: Protocol_BuyStorageContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.quant != rhs.quant {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_SellStorageContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SellStorageContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "storage_bytes"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.storageBytes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.storageBytes != 0 { + try visitor.visitSingularInt64Field(value: self.storageBytes, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_SellStorageContract, rhs: Protocol_SellStorageContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.storageBytes != rhs.storageBytes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_UpdateBrokerageContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UpdateBrokerageContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "brokerage"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.brokerage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if self.brokerage != 0 { + try visitor.visitSingularInt32Field(value: self.brokerage, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_UpdateBrokerageContract, rhs: Protocol_UpdateBrokerageContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.brokerage != rhs.brokerage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/vote_asset_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/vote_asset_contract.pb.swift new file mode 100644 index 000000000..f363d1853 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/vote_asset_contract.pb.swift @@ -0,0 +1,93 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/vote_asset_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_VoteAssetContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var voteAddress: [Data] = [] + + var support: Bool = false + + var count: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_VoteAssetContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".VoteAssetContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .standard(proto: "vote_address"), + 3: .same(proto: "support"), + 5: .same(proto: "count"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeRepeatedBytesField(value: &self.voteAddress) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.support) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self.count) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.voteAddress.isEmpty { + try visitor.visitRepeatedBytesField(value: self.voteAddress, fieldNumber: 2) + } + if self.support != false { + try visitor.visitSingularBoolField(value: self.support, fieldNumber: 3) + } + if self.count != 0 { + try visitor.visitSingularInt32Field(value: self.count, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_VoteAssetContract, rhs: Protocol_VoteAssetContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.voteAddress != rhs.voteAddress {return false} + if lhs.support != rhs.support {return false} + if lhs.count != rhs.count {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/BlockchainSdk/Blockchains/Tron/protobuf/contract/witness_contract.pb.swift b/BlockchainSdk/Blockchains/Tron/protobuf/contract/witness_contract.pb.swift new file mode 100644 index 000000000..fa6b58d05 --- /dev/null +++ b/BlockchainSdk/Blockchains/Tron/protobuf/contract/witness_contract.pb.swift @@ -0,0 +1,241 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: core/contract/witness_contract.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +struct Protocol_WitnessCreateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var url: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_WitnessUpdateContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var updateURL: Data = Data() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct Protocol_VoteWitnessContract: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var ownerAddress: Data = Data() + + var votes: [Protocol_VoteWitnessContract.Vote] = [] + + var support: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Vote: @unchecked Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var voteAddress: Data = Data() + + var voteCount: Int64 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protocol" + +extension Protocol_WitnessCreateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".WitnessCreateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "url"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.url) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.url.isEmpty { + try visitor.visitSingularBytesField(value: self.url, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_WitnessCreateContract, rhs: Protocol_WitnessCreateContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.url != rhs.url {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_WitnessUpdateContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".WitnessUpdateContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 12: .standard(proto: "update_url"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 12: try { try decoder.decodeSingularBytesField(value: &self.updateURL) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.updateURL.isEmpty { + try visitor.visitSingularBytesField(value: self.updateURL, fieldNumber: 12) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_WitnessUpdateContract, rhs: Protocol_WitnessUpdateContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.updateURL != rhs.updateURL {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_VoteWitnessContract: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".VoteWitnessContract" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "owner_address"), + 2: .same(proto: "votes"), + 3: .same(proto: "support"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.ownerAddress) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.votes) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.support) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.ownerAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.ownerAddress, fieldNumber: 1) + } + if !self.votes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.votes, fieldNumber: 2) + } + if self.support != false { + try visitor.visitSingularBoolField(value: self.support, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_VoteWitnessContract, rhs: Protocol_VoteWitnessContract) -> Bool { + if lhs.ownerAddress != rhs.ownerAddress {return false} + if lhs.votes != rhs.votes {return false} + if lhs.support != rhs.support {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Protocol_VoteWitnessContract.Vote: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Protocol_VoteWitnessContract.protoMessageName + ".Vote" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "vote_address"), + 2: .standard(proto: "vote_count"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.voteAddress) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.voteCount) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.voteAddress.isEmpty { + try visitor.visitSingularBytesField(value: self.voteAddress, fieldNumber: 1) + } + if self.voteCount != 0 { + try visitor.visitSingularInt64Field(value: self.voteCount, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Protocol_VoteWitnessContract.Vote, rhs: Protocol_VoteWitnessContract.Vote) -> Bool { + if lhs.voteAddress != rhs.voteAddress {return false} + if lhs.voteCount != rhs.voteCount {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +}