react-native-zcash 0.6.13 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/android/build.gradle +4 -4
  3. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2470000.json +8 -0
  4. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2480000.json +8 -0
  5. package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +51 -9
  6. package/ios/RNZcash.m +8 -0
  7. package/ios/RNZcash.swift +66 -16
  8. package/ios/ZCashLightClientKit/Block/Actions/DownloadAction.swift +1 -1
  9. package/ios/ZCashLightClientKit/Block/Actions/EnhanceAction.swift +3 -1
  10. package/ios/ZCashLightClientKit/Block/Actions/FetchUTXOsAction.swift +1 -1
  11. package/ios/ZCashLightClientKit/Block/Actions/ProcessSuggestedScanRangesAction.swift +11 -2
  12. package/ios/ZCashLightClientKit/Block/Actions/RewindAction.swift +2 -2
  13. package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +28 -11
  14. package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +4 -4
  15. package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +36 -7
  16. package/ios/ZCashLightClientKit/Block/Actions/ValidateServerAction.swift +1 -1
  17. package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +93 -51
  18. package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +0 -26
  19. package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +5 -6
  20. package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +1 -11
  21. package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +6 -4
  22. package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +10 -12
  23. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +38 -0
  24. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointURLProvider.swift +40 -0
  25. package/ios/ZCashLightClientKit/{Constants/Checkpoint+Constants.swift → Checkpoint/Checkpoint+helpers.swift} +1 -33
  26. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSource.swift +34 -0
  27. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSourceFactory.swift +14 -0
  28. package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +61 -6
  29. package/ios/ZCashLightClientKit/CombineSynchronizer.swift +63 -4
  30. package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +4 -0
  31. package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +21 -33
  32. package/ios/ZCashLightClientKit/DAO/UnspentTransactionOutputDao.swift +0 -182
  33. package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +0 -173
  34. package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +5 -2
  35. package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +1 -1
  36. package/ios/ZCashLightClientKit/Error/ZcashError.swift +53 -1
  37. package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +19 -1
  38. package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +32 -0
  39. package/ios/ZCashLightClientKit/Initializer.swift +8 -17
  40. package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +103 -217
  41. package/ios/ZCashLightClientKit/Model/Proposal.swift +45 -0
  42. package/ios/ZCashLightClientKit/Model/ScanSummary.swift +14 -0
  43. package/ios/ZCashLightClientKit/Model/WalletSummary.swift +58 -0
  44. package/ios/ZCashLightClientKit/Model/WalletTypes.swift +0 -16
  45. package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +5 -3
  46. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proposal.pb.swift +934 -0
  47. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proto/proposal.proto +138 -0
  48. package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +2 -4
  49. package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +9 -1
  50. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2272500.json +8 -0
  51. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2275000.json +8 -0
  52. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2277500.json +8 -0
  53. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2282500.json +8 -0
  54. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2285000.json +8 -0
  55. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2287500.json +8 -0
  56. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2292500.json +8 -0
  57. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2295000.json +8 -0
  58. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2297500.json +8 -0
  59. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2302500.json +8 -0
  60. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2305000.json +8 -0
  61. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2307500.json +8 -0
  62. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2312500.json +8 -0
  63. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2315000.json +8 -0
  64. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2317500.json +8 -0
  65. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2322500.json +8 -0
  66. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2325000.json +8 -0
  67. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2327500.json +8 -0
  68. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2332500.json +8 -0
  69. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2335000.json +8 -0
  70. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2337500.json +8 -0
  71. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2342500.json +8 -0
  72. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2345000.json +8 -0
  73. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2347500.json +8 -0
  74. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2352500.json +8 -0
  75. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2355000.json +8 -0
  76. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2357500.json +8 -0
  77. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2362500.json +8 -0
  78. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2365000.json +8 -0
  79. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2367500.json +8 -0
  80. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2372500.json +8 -0
  81. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2375000.json +8 -0
  82. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2377500.json +8 -0
  83. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2382500.json +8 -0
  84. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2385000.json +8 -0
  85. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2387500.json +8 -0
  86. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2392500.json +8 -0
  87. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2395000.json +8 -0
  88. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2397500.json +8 -0
  89. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2402500.json +8 -0
  90. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2405000.json +8 -0
  91. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2407500.json +8 -0
  92. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2412500.json +8 -0
  93. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2415000.json +8 -0
  94. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2417500.json +8 -0
  95. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2422500.json +8 -0
  96. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2425000.json +8 -0
  97. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2427500.json +8 -0
  98. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2432500.json +8 -0
  99. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2435000.json +8 -0
  100. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2437500.json +8 -0
  101. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2442500.json +8 -0
  102. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2445000.json +8 -0
  103. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2447500.json +8 -0
  104. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2452500.json +8 -0
  105. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2455000.json +8 -0
  106. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2457500.json +8 -0
  107. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2462500.json +8 -0
  108. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2465000.json +8 -0
  109. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2467500.json +8 -0
  110. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2470000.json +8 -0
  111. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2472500.json +8 -0
  112. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2480000.json +8 -0
  113. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2560000.json +8 -0
  114. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2570000.json +8 -0
  115. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2580000.json +8 -0
  116. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2590000.json +8 -0
  117. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2600000.json +8 -0
  118. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2610000.json +8 -0
  119. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2620000.json +8 -0
  120. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2630000.json +8 -0
  121. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2640000.json +8 -0
  122. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2650000.json +8 -0
  123. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2660000.json +8 -0
  124. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2670000.json +8 -0
  125. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2680000.json +8 -0
  126. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2690000.json +8 -0
  127. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2700000.json +8 -0
  128. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2710000.json +8 -0
  129. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2720000.json +8 -0
  130. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2730000.json +8 -0
  131. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2740000.json +8 -0
  132. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2750000.json +8 -0
  133. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2760000.json +8 -0
  134. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2770000.json +8 -0
  135. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2780000.json +8 -0
  136. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2790000.json +8 -0
  137. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +1 -5
  138. package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +327 -153
  139. package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +78 -36
  140. package/ios/ZCashLightClientKit/Rust/zcashlc.h +1441 -0
  141. package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +43 -14
  142. package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +52 -14
  143. package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +10 -6
  144. package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +220 -70
  145. package/ios/ZCashLightClientKit/Synchronizer.swift +105 -29
  146. package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +61 -32
  147. package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +52 -61
  148. package/ios/ZCashLightClientKit/Utils/DBActor.swift +21 -0
  149. package/ios/ZCashLightClientKit/Utils/LoggingProxy.swift +5 -0
  150. package/ios/ZCashLightClientKit/Utils/OSLogger.swift +71 -14
  151. package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
  152. package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
  153. package/lib/rnzcash.rn.js +21 -6
  154. package/lib/rnzcash.rn.js.map +1 -1
  155. package/lib/src/react-native.d.ts +2 -1
  156. package/lib/src/types.d.ts +9 -1
  157. package/package.json +1 -1
  158. package/src/react-native.ts +23 -4
  159. package/src/types.ts +10 -1
  160. package/ios/ZCashLightClientKit/Model/ScanProgress.swift +0 -29
  161. package/ios/ZCashLightClientKit/Repository/UnspentTransactionOutputRepository.swift +0 -16
  162. /package/ios/ZCashLightClientKit/{Model → Checkpoint}/Checkpoint.swift +0 -0
@@ -0,0 +1,934 @@
1
+ // DO NOT EDIT.
2
+ // swift-format-ignore-file
3
+ //
4
+ // Generated by the Swift generator plugin for the protocol buffer compiler.
5
+ // Source: proto/proposal.proto
6
+ //
7
+ // For information on using the generated types, please see the documentation:
8
+ // https://github.com/apple/swift-protobuf/
9
+
10
+ // Copyright (c) 2023 The Zcash developers
11
+ // Distributed under the MIT software license, see the accompanying
12
+ // file COPYING or https://www.opensource.org/licenses/mit-license.php .
13
+
14
+ import Foundation
15
+ import SwiftProtobuf
16
+
17
+ // If the compiler emits an error on this type, it is because this file
18
+ // was generated by a version of the `protoc` Swift plug-in that is
19
+ // incompatible with the version of SwiftProtobuf to which you are linking.
20
+ // Please ensure that you are building against the same version of the API
21
+ // that was used to generate this file.
22
+ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
23
+ struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
24
+ typealias Version = _2
25
+ }
26
+
27
+ enum FfiValuePool: SwiftProtobuf.Enum {
28
+ typealias RawValue = Int
29
+
30
+ /// Protobuf requires that enums have a zero discriminant as the default
31
+ /// value. However, we need to require that a known value pool is selected,
32
+ /// and we do not want to fall back to any default, so sending the
33
+ /// PoolNotSpecified value will be treated as an error.
34
+ case poolNotSpecified // = 0
35
+
36
+ /// The transparent value pool (P2SH is not distinguished from P2PKH)
37
+ case transparent // = 1
38
+
39
+ /// The Sapling value pool
40
+ case sapling // = 2
41
+
42
+ /// The Orchard value pool
43
+ case orchard // = 3
44
+ case UNRECOGNIZED(Int)
45
+
46
+ init() {
47
+ self = .poolNotSpecified
48
+ }
49
+
50
+ init?(rawValue: Int) {
51
+ switch rawValue {
52
+ case 0: self = .poolNotSpecified
53
+ case 1: self = .transparent
54
+ case 2: self = .sapling
55
+ case 3: self = .orchard
56
+ default: self = .UNRECOGNIZED(rawValue)
57
+ }
58
+ }
59
+
60
+ var rawValue: Int {
61
+ switch self {
62
+ case .poolNotSpecified: return 0
63
+ case .transparent: return 1
64
+ case .sapling: return 2
65
+ case .orchard: return 3
66
+ case .UNRECOGNIZED(let i): return i
67
+ }
68
+ }
69
+
70
+ }
71
+
72
+ #if swift(>=4.2)
73
+
74
+ extension FfiValuePool: CaseIterable {
75
+ // The compiler won't synthesize support with the UNRECOGNIZED case.
76
+ static let allCases: [FfiValuePool] = [
77
+ .poolNotSpecified,
78
+ .transparent,
79
+ .sapling,
80
+ .orchard,
81
+ ]
82
+ }
83
+
84
+ #endif // swift(>=4.2)
85
+
86
+ /// The fee rule used in constructing a Proposal
87
+ enum FfiFeeRule: SwiftProtobuf.Enum {
88
+ typealias RawValue = Int
89
+
90
+ /// Protobuf requires that enums have a zero discriminant as the default
91
+ /// value. However, we need to require that a known fee rule is selected,
92
+ /// and we do not want to fall back to any default, so sending the
93
+ /// FeeRuleNotSpecified value will be treated as an error.
94
+ case notSpecified // = 0
95
+
96
+ /// 10000 ZAT
97
+ case preZip313 // = 1
98
+
99
+ /// 1000 ZAT
100
+ case zip313 // = 2
101
+
102
+ /// MAX(10000, 5000 * logical_actions) ZAT
103
+ case zip317 // = 3
104
+ case UNRECOGNIZED(Int)
105
+
106
+ init() {
107
+ self = .notSpecified
108
+ }
109
+
110
+ init?(rawValue: Int) {
111
+ switch rawValue {
112
+ case 0: self = .notSpecified
113
+ case 1: self = .preZip313
114
+ case 2: self = .zip313
115
+ case 3: self = .zip317
116
+ default: self = .UNRECOGNIZED(rawValue)
117
+ }
118
+ }
119
+
120
+ var rawValue: Int {
121
+ switch self {
122
+ case .notSpecified: return 0
123
+ case .preZip313: return 1
124
+ case .zip313: return 2
125
+ case .zip317: return 3
126
+ case .UNRECOGNIZED(let i): return i
127
+ }
128
+ }
129
+
130
+ }
131
+
132
+ #if swift(>=4.2)
133
+
134
+ extension FfiFeeRule: CaseIterable {
135
+ // The compiler won't synthesize support with the UNRECOGNIZED case.
136
+ static let allCases: [FfiFeeRule] = [
137
+ .notSpecified,
138
+ .preZip313,
139
+ .zip313,
140
+ .zip317,
141
+ ]
142
+ }
143
+
144
+ #endif // swift(>=4.2)
145
+
146
+ /// A data structure that describes a series of transactions to be created.
147
+ struct FfiProposal {
148
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
149
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
150
+ // methods supported on all messages.
151
+
152
+ /// The version of this serialization format.
153
+ var protoVersion: UInt32 = 0
154
+
155
+ /// The fee rule used in constructing this proposal
156
+ var feeRule: FfiFeeRule = .notSpecified
157
+
158
+ /// The target height for which the proposal was constructed
159
+ ///
160
+ /// The chain must contain at least this many blocks in order for the proposal to
161
+ /// be executed.
162
+ var minTargetHeight: UInt32 = 0
163
+
164
+ /// The series of transactions to be created.
165
+ var steps: [FfiProposalStep] = []
166
+
167
+ var unknownFields = SwiftProtobuf.UnknownStorage()
168
+
169
+ init() {}
170
+ }
171
+
172
+ /// A data structure that describes the inputs to be consumed and outputs to
173
+ /// be produced in a proposed transaction.
174
+ struct FfiProposalStep {
175
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
176
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
177
+ // methods supported on all messages.
178
+
179
+ /// ZIP 321 serialized transaction request
180
+ var transactionRequest: String = String()
181
+
182
+ /// The vector of selected payment index / output pool mappings. Payment index
183
+ /// 0 corresponds to the payment with no explicit index.
184
+ var paymentOutputPools: [FfiPaymentOutputPool] = []
185
+
186
+ /// The anchor height to be used in creating the transaction, if any.
187
+ /// Setting the anchor height to zero will disallow the use of any shielded
188
+ /// inputs.
189
+ var anchorHeight: UInt32 = 0
190
+
191
+ /// The inputs to be used in creating the transaction.
192
+ var inputs: [FfiProposedInput] = []
193
+
194
+ /// The total value, fee value, and change outputs of the proposed
195
+ /// transaction
196
+ var balance: FfiTransactionBalance {
197
+ get {return _balance ?? FfiTransactionBalance()}
198
+ set {_balance = newValue}
199
+ }
200
+ /// Returns true if `balance` has been explicitly set.
201
+ var hasBalance: Bool {return self._balance != nil}
202
+ /// Clears the value of `balance`. Subsequent reads from it will return its default value.
203
+ mutating func clearBalance() {self._balance = nil}
204
+
205
+ /// A flag indicating whether the step is for a shielding transaction,
206
+ /// used for determining which OVK to select for wallet-internal outputs.
207
+ var isShielding: Bool = false
208
+
209
+ var unknownFields = SwiftProtobuf.UnknownStorage()
210
+
211
+ init() {}
212
+
213
+ fileprivate var _balance: FfiTransactionBalance? = nil
214
+ }
215
+
216
+ /// A mapping from ZIP 321 payment index to the output pool that has been chosen
217
+ /// for that payment, based upon the payment address and the selected inputs to
218
+ /// the transaction.
219
+ struct FfiPaymentOutputPool {
220
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
221
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
222
+ // methods supported on all messages.
223
+
224
+ var paymentIndex: UInt32 = 0
225
+
226
+ var valuePool: FfiValuePool = .poolNotSpecified
227
+
228
+ var unknownFields = SwiftProtobuf.UnknownStorage()
229
+
230
+ init() {}
231
+ }
232
+
233
+ /// The unique identifier and value for each proposed input that does not
234
+ /// require a back-reference to a prior step of the proposal.
235
+ struct FfiReceivedOutput {
236
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
237
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
238
+ // methods supported on all messages.
239
+
240
+ var txid: Data = Data()
241
+
242
+ var valuePool: FfiValuePool = .poolNotSpecified
243
+
244
+ var index: UInt32 = 0
245
+
246
+ var value: UInt64 = 0
247
+
248
+ var unknownFields = SwiftProtobuf.UnknownStorage()
249
+
250
+ init() {}
251
+ }
252
+
253
+ /// A reference a payment in a prior step of the proposal. This payment must
254
+ /// belong to the wallet.
255
+ struct FfiPriorStepOutput {
256
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
257
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
258
+ // methods supported on all messages.
259
+
260
+ var stepIndex: UInt32 = 0
261
+
262
+ var paymentIndex: UInt32 = 0
263
+
264
+ var unknownFields = SwiftProtobuf.UnknownStorage()
265
+
266
+ init() {}
267
+ }
268
+
269
+ /// A reference a change output from a prior step of the proposal.
270
+ struct FfiPriorStepChange {
271
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
272
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
273
+ // methods supported on all messages.
274
+
275
+ var stepIndex: UInt32 = 0
276
+
277
+ var changeIndex: UInt32 = 0
278
+
279
+ var unknownFields = SwiftProtobuf.UnknownStorage()
280
+
281
+ init() {}
282
+ }
283
+
284
+ /// The unique identifier and value for an input to be used in the transaction.
285
+ struct FfiProposedInput {
286
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
287
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
288
+ // methods supported on all messages.
289
+
290
+ var value: FfiProposedInput.OneOf_Value? = nil
291
+
292
+ var receivedOutput: FfiReceivedOutput {
293
+ get {
294
+ if case .receivedOutput(let v)? = value {return v}
295
+ return FfiReceivedOutput()
296
+ }
297
+ set {value = .receivedOutput(newValue)}
298
+ }
299
+
300
+ var priorStepOutput: FfiPriorStepOutput {
301
+ get {
302
+ if case .priorStepOutput(let v)? = value {return v}
303
+ return FfiPriorStepOutput()
304
+ }
305
+ set {value = .priorStepOutput(newValue)}
306
+ }
307
+
308
+ var priorStepChange: FfiPriorStepChange {
309
+ get {
310
+ if case .priorStepChange(let v)? = value {return v}
311
+ return FfiPriorStepChange()
312
+ }
313
+ set {value = .priorStepChange(newValue)}
314
+ }
315
+
316
+ var unknownFields = SwiftProtobuf.UnknownStorage()
317
+
318
+ enum OneOf_Value: Equatable {
319
+ case receivedOutput(FfiReceivedOutput)
320
+ case priorStepOutput(FfiPriorStepOutput)
321
+ case priorStepChange(FfiPriorStepChange)
322
+
323
+ #if !swift(>=4.1)
324
+ static func ==(lhs: FfiProposedInput.OneOf_Value, rhs: FfiProposedInput.OneOf_Value) -> Bool {
325
+ // The use of inline closures is to circumvent an issue where the compiler
326
+ // allocates stack space for every case branch when no optimizations are
327
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
328
+ switch (lhs, rhs) {
329
+ case (.receivedOutput, .receivedOutput): return {
330
+ guard case .receivedOutput(let l) = lhs, case .receivedOutput(let r) = rhs else { preconditionFailure() }
331
+ return l == r
332
+ }()
333
+ case (.priorStepOutput, .priorStepOutput): return {
334
+ guard case .priorStepOutput(let l) = lhs, case .priorStepOutput(let r) = rhs else { preconditionFailure() }
335
+ return l == r
336
+ }()
337
+ case (.priorStepChange, .priorStepChange): return {
338
+ guard case .priorStepChange(let l) = lhs, case .priorStepChange(let r) = rhs else { preconditionFailure() }
339
+ return l == r
340
+ }()
341
+ default: return false
342
+ }
343
+ }
344
+ #endif
345
+ }
346
+
347
+ init() {}
348
+ }
349
+
350
+ /// The proposed change outputs and fee value.
351
+ struct FfiTransactionBalance {
352
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
353
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
354
+ // methods supported on all messages.
355
+
356
+ /// A list of change output values.
357
+ var proposedChange: [FfiChangeValue] = []
358
+
359
+ /// The fee to be paid by the proposed transaction, in zatoshis.
360
+ var feeRequired: UInt64 = 0
361
+
362
+ var unknownFields = SwiftProtobuf.UnknownStorage()
363
+
364
+ init() {}
365
+ }
366
+
367
+ /// A proposed change output. If the transparent value pool is selected,
368
+ /// the `memo` field must be null.
369
+ struct FfiChangeValue {
370
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
371
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
372
+ // methods supported on all messages.
373
+
374
+ /// The value of a change output to be created, in zatoshis.
375
+ var value: UInt64 = 0
376
+
377
+ /// The value pool in which the change output should be created.
378
+ var valuePool: FfiValuePool = .poolNotSpecified
379
+
380
+ /// The optional memo that should be associated with the newly created change output.
381
+ /// Memos must not be present for transparent change outputs.
382
+ var memo: FfiMemoBytes {
383
+ get {return _memo ?? FfiMemoBytes()}
384
+ set {_memo = newValue}
385
+ }
386
+ /// Returns true if `memo` has been explicitly set.
387
+ var hasMemo: Bool {return self._memo != nil}
388
+ /// Clears the value of `memo`. Subsequent reads from it will return its default value.
389
+ mutating func clearMemo() {self._memo = nil}
390
+
391
+ var unknownFields = SwiftProtobuf.UnknownStorage()
392
+
393
+ init() {}
394
+
395
+ fileprivate var _memo: FfiMemoBytes? = nil
396
+ }
397
+
398
+ /// An object wrapper for memo bytes, to facilitate representing the
399
+ /// `change_memo == None` case.
400
+ struct FfiMemoBytes {
401
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
402
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
403
+ // methods supported on all messages.
404
+
405
+ var value: Data = Data()
406
+
407
+ var unknownFields = SwiftProtobuf.UnknownStorage()
408
+
409
+ init() {}
410
+ }
411
+
412
+ #if swift(>=5.5) && canImport(_Concurrency)
413
+ extension FfiValuePool: @unchecked Sendable {}
414
+ extension FfiFeeRule: @unchecked Sendable {}
415
+ extension FfiProposal: @unchecked Sendable {}
416
+ extension FfiProposalStep: @unchecked Sendable {}
417
+ extension FfiPaymentOutputPool: @unchecked Sendable {}
418
+ extension FfiReceivedOutput: @unchecked Sendable {}
419
+ extension FfiPriorStepOutput: @unchecked Sendable {}
420
+ extension FfiPriorStepChange: @unchecked Sendable {}
421
+ extension FfiProposedInput: @unchecked Sendable {}
422
+ extension FfiProposedInput.OneOf_Value: @unchecked Sendable {}
423
+ extension FfiTransactionBalance: @unchecked Sendable {}
424
+ extension FfiChangeValue: @unchecked Sendable {}
425
+ extension FfiMemoBytes: @unchecked Sendable {}
426
+ #endif // swift(>=5.5) && canImport(_Concurrency)
427
+
428
+ // MARK: - Code below here is support for the SwiftProtobuf runtime.
429
+
430
+ fileprivate let _protobuf_package = "cash.z.wallet.sdk.ffi"
431
+
432
+ extension FfiValuePool: SwiftProtobuf._ProtoNameProviding {
433
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
434
+ 0: .same(proto: "PoolNotSpecified"),
435
+ 1: .same(proto: "Transparent"),
436
+ 2: .same(proto: "Sapling"),
437
+ 3: .same(proto: "Orchard"),
438
+ ]
439
+ }
440
+
441
+ extension FfiFeeRule: SwiftProtobuf._ProtoNameProviding {
442
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
443
+ 0: .same(proto: "FeeRuleNotSpecified"),
444
+ 1: .same(proto: "PreZip313"),
445
+ 2: .same(proto: "Zip313"),
446
+ 3: .same(proto: "Zip317"),
447
+ ]
448
+ }
449
+
450
+ extension FfiProposal: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
451
+ static let protoMessageName: String = _protobuf_package + ".Proposal"
452
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
453
+ 1: .same(proto: "protoVersion"),
454
+ 2: .same(proto: "feeRule"),
455
+ 3: .same(proto: "minTargetHeight"),
456
+ 4: .same(proto: "steps"),
457
+ ]
458
+
459
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
460
+ while let fieldNumber = try decoder.nextFieldNumber() {
461
+ // The use of inline closures is to circumvent an issue where the compiler
462
+ // allocates stack space for every case branch when no optimizations are
463
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
464
+ switch fieldNumber {
465
+ case 1: try { try decoder.decodeSingularUInt32Field(value: &self.protoVersion) }()
466
+ case 2: try { try decoder.decodeSingularEnumField(value: &self.feeRule) }()
467
+ case 3: try { try decoder.decodeSingularUInt32Field(value: &self.minTargetHeight) }()
468
+ case 4: try { try decoder.decodeRepeatedMessageField(value: &self.steps) }()
469
+ default: break
470
+ }
471
+ }
472
+ }
473
+
474
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
475
+ if self.protoVersion != 0 {
476
+ try visitor.visitSingularUInt32Field(value: self.protoVersion, fieldNumber: 1)
477
+ }
478
+ if self.feeRule != .notSpecified {
479
+ try visitor.visitSingularEnumField(value: self.feeRule, fieldNumber: 2)
480
+ }
481
+ if self.minTargetHeight != 0 {
482
+ try visitor.visitSingularUInt32Field(value: self.minTargetHeight, fieldNumber: 3)
483
+ }
484
+ if !self.steps.isEmpty {
485
+ try visitor.visitRepeatedMessageField(value: self.steps, fieldNumber: 4)
486
+ }
487
+ try unknownFields.traverse(visitor: &visitor)
488
+ }
489
+
490
+ static func ==(lhs: FfiProposal, rhs: FfiProposal) -> Bool {
491
+ if lhs.protoVersion != rhs.protoVersion {return false}
492
+ if lhs.feeRule != rhs.feeRule {return false}
493
+ if lhs.minTargetHeight != rhs.minTargetHeight {return false}
494
+ if lhs.steps != rhs.steps {return false}
495
+ if lhs.unknownFields != rhs.unknownFields {return false}
496
+ return true
497
+ }
498
+ }
499
+
500
+ extension FfiProposalStep: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
501
+ static let protoMessageName: String = _protobuf_package + ".ProposalStep"
502
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
503
+ 1: .same(proto: "transactionRequest"),
504
+ 2: .same(proto: "paymentOutputPools"),
505
+ 3: .same(proto: "anchorHeight"),
506
+ 4: .same(proto: "inputs"),
507
+ 5: .same(proto: "balance"),
508
+ 6: .same(proto: "isShielding"),
509
+ ]
510
+
511
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
512
+ while let fieldNumber = try decoder.nextFieldNumber() {
513
+ // The use of inline closures is to circumvent an issue where the compiler
514
+ // allocates stack space for every case branch when no optimizations are
515
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
516
+ switch fieldNumber {
517
+ case 1: try { try decoder.decodeSingularStringField(value: &self.transactionRequest) }()
518
+ case 2: try { try decoder.decodeRepeatedMessageField(value: &self.paymentOutputPools) }()
519
+ case 3: try { try decoder.decodeSingularUInt32Field(value: &self.anchorHeight) }()
520
+ case 4: try { try decoder.decodeRepeatedMessageField(value: &self.inputs) }()
521
+ case 5: try { try decoder.decodeSingularMessageField(value: &self._balance) }()
522
+ case 6: try { try decoder.decodeSingularBoolField(value: &self.isShielding) }()
523
+ default: break
524
+ }
525
+ }
526
+ }
527
+
528
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
529
+ // The use of inline closures is to circumvent an issue where the compiler
530
+ // allocates stack space for every if/case branch local when no optimizations
531
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
532
+ // https://github.com/apple/swift-protobuf/issues/1182
533
+ if !self.transactionRequest.isEmpty {
534
+ try visitor.visitSingularStringField(value: self.transactionRequest, fieldNumber: 1)
535
+ }
536
+ if !self.paymentOutputPools.isEmpty {
537
+ try visitor.visitRepeatedMessageField(value: self.paymentOutputPools, fieldNumber: 2)
538
+ }
539
+ if self.anchorHeight != 0 {
540
+ try visitor.visitSingularUInt32Field(value: self.anchorHeight, fieldNumber: 3)
541
+ }
542
+ if !self.inputs.isEmpty {
543
+ try visitor.visitRepeatedMessageField(value: self.inputs, fieldNumber: 4)
544
+ }
545
+ try { if let v = self._balance {
546
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
547
+ } }()
548
+ if self.isShielding != false {
549
+ try visitor.visitSingularBoolField(value: self.isShielding, fieldNumber: 6)
550
+ }
551
+ try unknownFields.traverse(visitor: &visitor)
552
+ }
553
+
554
+ static func ==(lhs: FfiProposalStep, rhs: FfiProposalStep) -> Bool {
555
+ if lhs.transactionRequest != rhs.transactionRequest {return false}
556
+ if lhs.paymentOutputPools != rhs.paymentOutputPools {return false}
557
+ if lhs.anchorHeight != rhs.anchorHeight {return false}
558
+ if lhs.inputs != rhs.inputs {return false}
559
+ if lhs._balance != rhs._balance {return false}
560
+ if lhs.isShielding != rhs.isShielding {return false}
561
+ if lhs.unknownFields != rhs.unknownFields {return false}
562
+ return true
563
+ }
564
+ }
565
+
566
+ extension FfiPaymentOutputPool: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
567
+ static let protoMessageName: String = _protobuf_package + ".PaymentOutputPool"
568
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
569
+ 1: .same(proto: "paymentIndex"),
570
+ 2: .same(proto: "valuePool"),
571
+ ]
572
+
573
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
574
+ while let fieldNumber = try decoder.nextFieldNumber() {
575
+ // The use of inline closures is to circumvent an issue where the compiler
576
+ // allocates stack space for every case branch when no optimizations are
577
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
578
+ switch fieldNumber {
579
+ case 1: try { try decoder.decodeSingularUInt32Field(value: &self.paymentIndex) }()
580
+ case 2: try { try decoder.decodeSingularEnumField(value: &self.valuePool) }()
581
+ default: break
582
+ }
583
+ }
584
+ }
585
+
586
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
587
+ if self.paymentIndex != 0 {
588
+ try visitor.visitSingularUInt32Field(value: self.paymentIndex, fieldNumber: 1)
589
+ }
590
+ if self.valuePool != .poolNotSpecified {
591
+ try visitor.visitSingularEnumField(value: self.valuePool, fieldNumber: 2)
592
+ }
593
+ try unknownFields.traverse(visitor: &visitor)
594
+ }
595
+
596
+ static func ==(lhs: FfiPaymentOutputPool, rhs: FfiPaymentOutputPool) -> Bool {
597
+ if lhs.paymentIndex != rhs.paymentIndex {return false}
598
+ if lhs.valuePool != rhs.valuePool {return false}
599
+ if lhs.unknownFields != rhs.unknownFields {return false}
600
+ return true
601
+ }
602
+ }
603
+
604
+ extension FfiReceivedOutput: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
605
+ static let protoMessageName: String = _protobuf_package + ".ReceivedOutput"
606
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
607
+ 1: .same(proto: "txid"),
608
+ 2: .same(proto: "valuePool"),
609
+ 3: .same(proto: "index"),
610
+ 4: .same(proto: "value"),
611
+ ]
612
+
613
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
614
+ while let fieldNumber = try decoder.nextFieldNumber() {
615
+ // The use of inline closures is to circumvent an issue where the compiler
616
+ // allocates stack space for every case branch when no optimizations are
617
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
618
+ switch fieldNumber {
619
+ case 1: try { try decoder.decodeSingularBytesField(value: &self.txid) }()
620
+ case 2: try { try decoder.decodeSingularEnumField(value: &self.valuePool) }()
621
+ case 3: try { try decoder.decodeSingularUInt32Field(value: &self.index) }()
622
+ case 4: try { try decoder.decodeSingularUInt64Field(value: &self.value) }()
623
+ default: break
624
+ }
625
+ }
626
+ }
627
+
628
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
629
+ if !self.txid.isEmpty {
630
+ try visitor.visitSingularBytesField(value: self.txid, fieldNumber: 1)
631
+ }
632
+ if self.valuePool != .poolNotSpecified {
633
+ try visitor.visitSingularEnumField(value: self.valuePool, fieldNumber: 2)
634
+ }
635
+ if self.index != 0 {
636
+ try visitor.visitSingularUInt32Field(value: self.index, fieldNumber: 3)
637
+ }
638
+ if self.value != 0 {
639
+ try visitor.visitSingularUInt64Field(value: self.value, fieldNumber: 4)
640
+ }
641
+ try unknownFields.traverse(visitor: &visitor)
642
+ }
643
+
644
+ static func ==(lhs: FfiReceivedOutput, rhs: FfiReceivedOutput) -> Bool {
645
+ if lhs.txid != rhs.txid {return false}
646
+ if lhs.valuePool != rhs.valuePool {return false}
647
+ if lhs.index != rhs.index {return false}
648
+ if lhs.value != rhs.value {return false}
649
+ if lhs.unknownFields != rhs.unknownFields {return false}
650
+ return true
651
+ }
652
+ }
653
+
654
+ extension FfiPriorStepOutput: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
655
+ static let protoMessageName: String = _protobuf_package + ".PriorStepOutput"
656
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
657
+ 1: .same(proto: "stepIndex"),
658
+ 2: .same(proto: "paymentIndex"),
659
+ ]
660
+
661
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
662
+ while let fieldNumber = try decoder.nextFieldNumber() {
663
+ // The use of inline closures is to circumvent an issue where the compiler
664
+ // allocates stack space for every case branch when no optimizations are
665
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
666
+ switch fieldNumber {
667
+ case 1: try { try decoder.decodeSingularUInt32Field(value: &self.stepIndex) }()
668
+ case 2: try { try decoder.decodeSingularUInt32Field(value: &self.paymentIndex) }()
669
+ default: break
670
+ }
671
+ }
672
+ }
673
+
674
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
675
+ if self.stepIndex != 0 {
676
+ try visitor.visitSingularUInt32Field(value: self.stepIndex, fieldNumber: 1)
677
+ }
678
+ if self.paymentIndex != 0 {
679
+ try visitor.visitSingularUInt32Field(value: self.paymentIndex, fieldNumber: 2)
680
+ }
681
+ try unknownFields.traverse(visitor: &visitor)
682
+ }
683
+
684
+ static func ==(lhs: FfiPriorStepOutput, rhs: FfiPriorStepOutput) -> Bool {
685
+ if lhs.stepIndex != rhs.stepIndex {return false}
686
+ if lhs.paymentIndex != rhs.paymentIndex {return false}
687
+ if lhs.unknownFields != rhs.unknownFields {return false}
688
+ return true
689
+ }
690
+ }
691
+
692
+ extension FfiPriorStepChange: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
693
+ static let protoMessageName: String = _protobuf_package + ".PriorStepChange"
694
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
695
+ 1: .same(proto: "stepIndex"),
696
+ 2: .same(proto: "changeIndex"),
697
+ ]
698
+
699
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
700
+ while let fieldNumber = try decoder.nextFieldNumber() {
701
+ // The use of inline closures is to circumvent an issue where the compiler
702
+ // allocates stack space for every case branch when no optimizations are
703
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
704
+ switch fieldNumber {
705
+ case 1: try { try decoder.decodeSingularUInt32Field(value: &self.stepIndex) }()
706
+ case 2: try { try decoder.decodeSingularUInt32Field(value: &self.changeIndex) }()
707
+ default: break
708
+ }
709
+ }
710
+ }
711
+
712
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
713
+ if self.stepIndex != 0 {
714
+ try visitor.visitSingularUInt32Field(value: self.stepIndex, fieldNumber: 1)
715
+ }
716
+ if self.changeIndex != 0 {
717
+ try visitor.visitSingularUInt32Field(value: self.changeIndex, fieldNumber: 2)
718
+ }
719
+ try unknownFields.traverse(visitor: &visitor)
720
+ }
721
+
722
+ static func ==(lhs: FfiPriorStepChange, rhs: FfiPriorStepChange) -> Bool {
723
+ if lhs.stepIndex != rhs.stepIndex {return false}
724
+ if lhs.changeIndex != rhs.changeIndex {return false}
725
+ if lhs.unknownFields != rhs.unknownFields {return false}
726
+ return true
727
+ }
728
+ }
729
+
730
+ extension FfiProposedInput: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
731
+ static let protoMessageName: String = _protobuf_package + ".ProposedInput"
732
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
733
+ 1: .same(proto: "receivedOutput"),
734
+ 2: .same(proto: "priorStepOutput"),
735
+ 3: .same(proto: "priorStepChange"),
736
+ ]
737
+
738
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
739
+ while let fieldNumber = try decoder.nextFieldNumber() {
740
+ // The use of inline closures is to circumvent an issue where the compiler
741
+ // allocates stack space for every case branch when no optimizations are
742
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
743
+ switch fieldNumber {
744
+ case 1: try {
745
+ var v: FfiReceivedOutput?
746
+ var hadOneofValue = false
747
+ if let current = self.value {
748
+ hadOneofValue = true
749
+ if case .receivedOutput(let m) = current {v = m}
750
+ }
751
+ try decoder.decodeSingularMessageField(value: &v)
752
+ if let v = v {
753
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
754
+ self.value = .receivedOutput(v)
755
+ }
756
+ }()
757
+ case 2: try {
758
+ var v: FfiPriorStepOutput?
759
+ var hadOneofValue = false
760
+ if let current = self.value {
761
+ hadOneofValue = true
762
+ if case .priorStepOutput(let m) = current {v = m}
763
+ }
764
+ try decoder.decodeSingularMessageField(value: &v)
765
+ if let v = v {
766
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
767
+ self.value = .priorStepOutput(v)
768
+ }
769
+ }()
770
+ case 3: try {
771
+ var v: FfiPriorStepChange?
772
+ var hadOneofValue = false
773
+ if let current = self.value {
774
+ hadOneofValue = true
775
+ if case .priorStepChange(let m) = current {v = m}
776
+ }
777
+ try decoder.decodeSingularMessageField(value: &v)
778
+ if let v = v {
779
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
780
+ self.value = .priorStepChange(v)
781
+ }
782
+ }()
783
+ default: break
784
+ }
785
+ }
786
+ }
787
+
788
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
789
+ // The use of inline closures is to circumvent an issue where the compiler
790
+ // allocates stack space for every if/case branch local when no optimizations
791
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
792
+ // https://github.com/apple/swift-protobuf/issues/1182
793
+ switch self.value {
794
+ case .receivedOutput?: try {
795
+ guard case .receivedOutput(let v)? = self.value else { preconditionFailure() }
796
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
797
+ }()
798
+ case .priorStepOutput?: try {
799
+ guard case .priorStepOutput(let v)? = self.value else { preconditionFailure() }
800
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
801
+ }()
802
+ case .priorStepChange?: try {
803
+ guard case .priorStepChange(let v)? = self.value else { preconditionFailure() }
804
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
805
+ }()
806
+ case nil: break
807
+ }
808
+ try unknownFields.traverse(visitor: &visitor)
809
+ }
810
+
811
+ static func ==(lhs: FfiProposedInput, rhs: FfiProposedInput) -> Bool {
812
+ if lhs.value != rhs.value {return false}
813
+ if lhs.unknownFields != rhs.unknownFields {return false}
814
+ return true
815
+ }
816
+ }
817
+
818
+ extension FfiTransactionBalance: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
819
+ static let protoMessageName: String = _protobuf_package + ".TransactionBalance"
820
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
821
+ 1: .same(proto: "proposedChange"),
822
+ 2: .same(proto: "feeRequired"),
823
+ ]
824
+
825
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
826
+ while let fieldNumber = try decoder.nextFieldNumber() {
827
+ // The use of inline closures is to circumvent an issue where the compiler
828
+ // allocates stack space for every case branch when no optimizations are
829
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
830
+ switch fieldNumber {
831
+ case 1: try { try decoder.decodeRepeatedMessageField(value: &self.proposedChange) }()
832
+ case 2: try { try decoder.decodeSingularUInt64Field(value: &self.feeRequired) }()
833
+ default: break
834
+ }
835
+ }
836
+ }
837
+
838
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
839
+ if !self.proposedChange.isEmpty {
840
+ try visitor.visitRepeatedMessageField(value: self.proposedChange, fieldNumber: 1)
841
+ }
842
+ if self.feeRequired != 0 {
843
+ try visitor.visitSingularUInt64Field(value: self.feeRequired, fieldNumber: 2)
844
+ }
845
+ try unknownFields.traverse(visitor: &visitor)
846
+ }
847
+
848
+ static func ==(lhs: FfiTransactionBalance, rhs: FfiTransactionBalance) -> Bool {
849
+ if lhs.proposedChange != rhs.proposedChange {return false}
850
+ if lhs.feeRequired != rhs.feeRequired {return false}
851
+ if lhs.unknownFields != rhs.unknownFields {return false}
852
+ return true
853
+ }
854
+ }
855
+
856
+ extension FfiChangeValue: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
857
+ static let protoMessageName: String = _protobuf_package + ".ChangeValue"
858
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
859
+ 1: .same(proto: "value"),
860
+ 2: .same(proto: "valuePool"),
861
+ 3: .same(proto: "memo"),
862
+ ]
863
+
864
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
865
+ while let fieldNumber = try decoder.nextFieldNumber() {
866
+ // The use of inline closures is to circumvent an issue where the compiler
867
+ // allocates stack space for every case branch when no optimizations are
868
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
869
+ switch fieldNumber {
870
+ case 1: try { try decoder.decodeSingularUInt64Field(value: &self.value) }()
871
+ case 2: try { try decoder.decodeSingularEnumField(value: &self.valuePool) }()
872
+ case 3: try { try decoder.decodeSingularMessageField(value: &self._memo) }()
873
+ default: break
874
+ }
875
+ }
876
+ }
877
+
878
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
879
+ // The use of inline closures is to circumvent an issue where the compiler
880
+ // allocates stack space for every if/case branch local when no optimizations
881
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
882
+ // https://github.com/apple/swift-protobuf/issues/1182
883
+ if self.value != 0 {
884
+ try visitor.visitSingularUInt64Field(value: self.value, fieldNumber: 1)
885
+ }
886
+ if self.valuePool != .poolNotSpecified {
887
+ try visitor.visitSingularEnumField(value: self.valuePool, fieldNumber: 2)
888
+ }
889
+ try { if let v = self._memo {
890
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
891
+ } }()
892
+ try unknownFields.traverse(visitor: &visitor)
893
+ }
894
+
895
+ static func ==(lhs: FfiChangeValue, rhs: FfiChangeValue) -> Bool {
896
+ if lhs.value != rhs.value {return false}
897
+ if lhs.valuePool != rhs.valuePool {return false}
898
+ if lhs._memo != rhs._memo {return false}
899
+ if lhs.unknownFields != rhs.unknownFields {return false}
900
+ return true
901
+ }
902
+ }
903
+
904
+ extension FfiMemoBytes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
905
+ static let protoMessageName: String = _protobuf_package + ".MemoBytes"
906
+ static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
907
+ 1: .same(proto: "value"),
908
+ ]
909
+
910
+ mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
911
+ while let fieldNumber = try decoder.nextFieldNumber() {
912
+ // The use of inline closures is to circumvent an issue where the compiler
913
+ // allocates stack space for every case branch when no optimizations are
914
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
915
+ switch fieldNumber {
916
+ case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }()
917
+ default: break
918
+ }
919
+ }
920
+ }
921
+
922
+ func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
923
+ if !self.value.isEmpty {
924
+ try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1)
925
+ }
926
+ try unknownFields.traverse(visitor: &visitor)
927
+ }
928
+
929
+ static func ==(lhs: FfiMemoBytes, rhs: FfiMemoBytes) -> Bool {
930
+ if lhs.value != rhs.value {return false}
931
+ if lhs.unknownFields != rhs.unknownFields {return false}
932
+ return true
933
+ }
934
+ }