react-native-zcash 0.9.12 → 0.10.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 (281) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +6 -6
  3. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3100000.json +8 -0
  4. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3110000.json +8 -0
  5. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3120000.json +8 -0
  6. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3130000.json +8 -0
  7. package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +126 -69
  8. package/ios/RNZcash.m +0 -5
  9. package/ios/RNZcash.swift +153 -104
  10. package/ios/ZCashLightClientKit/Account/Account.swift +48 -0
  11. package/ios/ZCashLightClientKit/Account/AccountMetadataKey.swift +96 -0
  12. package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +23 -4
  13. package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +6 -2
  14. package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +4 -2
  15. package/ios/ZCashLightClientKit/Block/Actions/ValidateServerAction.swift +4 -1
  16. package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +83 -16
  17. package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +4 -2
  18. package/ios/ZCashLightClientKit/Block/Download/BlockDownloaderService.swift +22 -19
  19. package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +50 -19
  20. package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +5 -3
  21. package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +22 -5
  22. package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +2 -1
  23. package/ios/ZCashLightClientKit/Block/Utils/CompactBlockProgress.swift +5 -3
  24. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +88 -0
  25. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSource.swift +4 -0
  26. package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +52 -21
  27. package/ios/ZCashLightClientKit/CombineSynchronizer.swift +49 -27
  28. package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +8 -2
  29. package/ios/ZCashLightClientKit/DAO/BlockDao.swift +65 -0
  30. package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +86 -1
  31. package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +4 -4
  32. package/ios/ZCashLightClientKit/Entity/Pczt.swift +10 -0
  33. package/ios/ZCashLightClientKit/Entity/SentNoteEntity.swift +2 -2
  34. package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +40 -16
  35. package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +1 -1
  36. package/ios/ZCashLightClientKit/Error/ZcashError.swift +182 -14
  37. package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +63 -5
  38. package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +122 -12
  39. package/ios/ZCashLightClientKit/Initializer.swift +49 -14
  40. package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +15 -6
  41. package/ios/ZCashLightClientKit/Model/SingleUseTransparentAddress.swift +29 -0
  42. package/ios/ZCashLightClientKit/Model/TransactionDataRequest.swift +83 -2
  43. package/ios/ZCashLightClientKit/Model/WalletSummary.swift +21 -4
  44. package/ios/ZCashLightClientKit/Model/WalletTypes.swift +38 -8
  45. package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +177 -45
  46. package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +63 -16
  47. package/ios/ZCashLightClientKit/Modules/Service/Tor/LightWalletGRPCServiceOverTor.swift +273 -0
  48. package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +5 -2
  49. package/ios/ZCashLightClientKit/Repository/TransactionRepository.swift +2 -0
  50. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2675000.json +8 -0
  51. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2677500.json +8 -0
  52. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2682500.json +8 -0
  53. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2685000.json +8 -0
  54. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2687500.json +8 -0
  55. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2692500.json +8 -0
  56. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2695000.json +8 -0
  57. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2697500.json +8 -0
  58. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2702500.json +8 -0
  59. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2705000.json +8 -0
  60. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2707500.json +8 -0
  61. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2712500.json +8 -0
  62. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2715000.json +8 -0
  63. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2717500.json +8 -0
  64. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2722500.json +8 -0
  65. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2725000.json +8 -0
  66. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2727500.json +8 -0
  67. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2732500.json +8 -0
  68. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2735000.json +8 -0
  69. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2737500.json +8 -0
  70. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2742500.json +8 -0
  71. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2745000.json +8 -0
  72. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2747500.json +8 -0
  73. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2752500.json +8 -0
  74. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2755000.json +8 -0
  75. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2757500.json +8 -0
  76. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2762500.json +8 -0
  77. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2765000.json +8 -0
  78. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2767500.json +8 -0
  79. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2772500.json +8 -0
  80. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2775000.json +8 -0
  81. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2777500.json +8 -0
  82. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2782500.json +8 -0
  83. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2785000.json +8 -0
  84. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2787500.json +8 -0
  85. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2792500.json +8 -0
  86. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2795000.json +8 -0
  87. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2797500.json +8 -0
  88. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2802500.json +8 -0
  89. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2805000.json +8 -0
  90. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2807500.json +8 -0
  91. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2812500.json +8 -0
  92. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2815000.json +8 -0
  93. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2817500.json +8 -0
  94. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2822500.json +8 -0
  95. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2825000.json +8 -0
  96. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2827500.json +8 -0
  97. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2832500.json +8 -0
  98. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2835000.json +8 -0
  99. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2837500.json +8 -0
  100. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2842500.json +8 -0
  101. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2845000.json +8 -0
  102. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2847500.json +8 -0
  103. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2852500.json +8 -0
  104. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2855000.json +8 -0
  105. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2857500.json +8 -0
  106. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2862500.json +8 -0
  107. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2865000.json +8 -0
  108. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2867500.json +8 -0
  109. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2872500.json +8 -0
  110. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2875000.json +8 -0
  111. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2877500.json +8 -0
  112. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2882500.json +8 -0
  113. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2885000.json +8 -0
  114. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2887500.json +8 -0
  115. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2892500.json +8 -0
  116. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2895000.json +8 -0
  117. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2897500.json +8 -0
  118. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2902500.json +8 -0
  119. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2905000.json +8 -0
  120. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2907500.json +8 -0
  121. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2912500.json +8 -0
  122. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2915000.json +8 -0
  123. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2917500.json +8 -0
  124. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2922500.json +8 -0
  125. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2925000.json +8 -0
  126. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2927500.json +8 -0
  127. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2932500.json +8 -0
  128. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2935000.json +8 -0
  129. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2937500.json +8 -0
  130. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2942500.json +8 -0
  131. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2945000.json +8 -0
  132. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2947500.json +8 -0
  133. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2952500.json +8 -0
  134. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2955000.json +8 -0
  135. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2957500.json +8 -0
  136. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2962500.json +8 -0
  137. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2965000.json +8 -0
  138. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2967500.json +8 -0
  139. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2972500.json +8 -0
  140. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2975000.json +8 -0
  141. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2977500.json +8 -0
  142. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2982500.json +8 -0
  143. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2985000.json +8 -0
  144. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2987500.json +8 -0
  145. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2992500.json +8 -0
  146. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2995000.json +8 -0
  147. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2997500.json +8 -0
  148. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3002500.json +8 -0
  149. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3005000.json +8 -0
  150. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3007500.json +8 -0
  151. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3012500.json +8 -0
  152. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3015000.json +8 -0
  153. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3017500.json +8 -0
  154. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3022500.json +8 -0
  155. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3025000.json +8 -0
  156. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3027500.json +8 -0
  157. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3032500.json +8 -0
  158. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3035000.json +8 -0
  159. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3037500.json +8 -0
  160. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3042500.json +8 -0
  161. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3045000.json +8 -0
  162. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3047500.json +8 -0
  163. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3052500.json +8 -0
  164. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3055000.json +8 -0
  165. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3057500.json +8 -0
  166. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3062500.json +8 -0
  167. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3065000.json +8 -0
  168. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3067500.json +8 -0
  169. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3072500.json +8 -0
  170. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3075000.json +8 -0
  171. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3077500.json +8 -0
  172. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3082500.json +8 -0
  173. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3085000.json +8 -0
  174. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3087500.json +8 -0
  175. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3092500.json +8 -0
  176. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3095000.json +8 -0
  177. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3097500.json +8 -0
  178. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3100000.json +8 -0
  179. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3102500.json +8 -0
  180. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3105000.json +8 -0
  181. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3107500.json +8 -0
  182. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3110000.json +8 -0
  183. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3112500.json +8 -0
  184. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3115000.json +8 -0
  185. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3117500.json +8 -0
  186. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3120000.json +8 -0
  187. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3122500.json +8 -0
  188. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3125000.json +8 -0
  189. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3127500.json +8 -0
  190. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3130000.json +8 -0
  191. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3010000.json +8 -0
  192. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3020000.json +8 -0
  193. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3030000.json +8 -0
  194. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3040000.json +8 -0
  195. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3050000.json +8 -0
  196. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3060000.json +8 -0
  197. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3070000.json +8 -0
  198. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3080000.json +8 -0
  199. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3090000.json +8 -0
  200. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3100000.json +8 -0
  201. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3110000.json +8 -0
  202. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3120000.json +8 -0
  203. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3130000.json +8 -0
  204. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3140000.json +8 -0
  205. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3150000.json +8 -0
  206. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3160000.json +8 -0
  207. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3170000.json +8 -0
  208. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3180000.json +8 -0
  209. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3190000.json +8 -0
  210. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3200000.json +8 -0
  211. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3210000.json +8 -0
  212. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3220000.json +8 -0
  213. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3230000.json +8 -0
  214. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3240000.json +8 -0
  215. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3250000.json +8 -0
  216. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3260000.json +8 -0
  217. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3270000.json +8 -0
  218. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3280000.json +8 -0
  219. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3290000.json +8 -0
  220. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3300000.json +8 -0
  221. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3310000.json +8 -0
  222. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3320000.json +8 -0
  223. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3330000.json +8 -0
  224. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3340000.json +8 -0
  225. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3350000.json +8 -0
  226. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3360000.json +8 -0
  227. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3370000.json +8 -0
  228. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3380000.json +8 -0
  229. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3390000.json +8 -0
  230. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3400000.json +8 -0
  231. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3410000.json +8 -0
  232. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3420000.json +8 -0
  233. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3430000.json +8 -0
  234. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3440000.json +8 -0
  235. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3450000.json +8 -0
  236. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3460000.json +8 -0
  237. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3470000.json +8 -0
  238. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3480000.json +8 -0
  239. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3490000.json +8 -0
  240. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3500000.json +8 -0
  241. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3510000.json +8 -0
  242. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3520000.json +8 -0
  243. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3530000.json +8 -0
  244. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3540000.json +8 -0
  245. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3550000.json +8 -0
  246. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3560000.json +8 -0
  247. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3570000.json +8 -0
  248. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3580000.json +8 -0
  249. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3590000.json +8 -0
  250. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3600000.json +8 -0
  251. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3610000.json +8 -0
  252. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3620000.json +8 -0
  253. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3630000.json +8 -0
  254. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3640000.json +8 -0
  255. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3650000.json +8 -0
  256. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3660000.json +8 -0
  257. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3670000.json +8 -0
  258. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +89 -10
  259. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackendWelding.swift +39 -3
  260. package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +532 -74
  261. package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +97 -14
  262. package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +104 -28
  263. package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +105 -31
  264. package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +36 -9
  265. package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +401 -175
  266. package/ios/ZCashLightClientKit/Synchronizer.swift +192 -69
  267. package/ios/ZCashLightClientKit/Tool/DerivationTool.swift +69 -12
  268. package/ios/ZCashLightClientKit/Tor/TorClient.swift +502 -11
  269. package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +10 -6
  270. package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +24 -9
  271. package/ios/ZCashLightClientKit/Utils/SDKFlags.swift +71 -0
  272. package/ios/libzcashlc.xcframework/Info.plist +5 -5
  273. package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
  274. package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
  275. package/ios/zcashlc.h +1640 -378
  276. package/lib/rnzcash.rn.js.map +1 -1
  277. package/lib/src/react-native.d.ts +2 -2
  278. package/lib/src/types.d.ts +2 -0
  279. package/package.json +1 -1
  280. package/src/react-native.ts +2 -3
  281. package/src/types.ts +2 -0
@@ -54,21 +54,29 @@ class LiveLatestBlockHeightProvider: LatestBlockHeightProvider {
54
54
  }
55
55
  }
56
56
 
57
- class LightWalletGRPCService {
58
- let channel: Channel
59
- let connectionManager: ConnectionStatusManager
60
- let compactTxStreamer: CompactTxStreamerAsyncClient
57
+ // swiftlint:disable:next type_body_length
58
+ class LightWalletGRPCService: LightWalletService {
59
+ var channel: Channel?
60
+ var connectionManager: ConnectionStatusManager?
61
+ var compactTxStreamerInternal: CompactTxStreamerAsyncClient?
62
+ var compactTxStreamer: CompactTxStreamerAsyncClient {
63
+ resolveLazyConnect()
64
+ }
61
65
  let singleCallTimeout: TimeLimit
62
66
  let streamingCallTimeout: TimeLimit
63
67
  var latestBlockHeightProvider: LatestBlockHeightProvider = LiveLatestBlockHeightProvider()
64
68
 
69
+ let host: String
70
+ let port: Int
71
+ let secure: Bool
72
+
65
73
  var connectionStateChange: ((_ from: ConnectionState, _ to: ConnectionState) -> Void)? {
66
- get { connectionManager.connectionStateChange }
67
- set { connectionManager.connectionStateChange = newValue }
74
+ get { connectionManager?.connectionStateChange }
75
+ set { connectionManager?.connectionStateChange = newValue }
68
76
  }
69
77
 
70
78
  let queue: DispatchQueue
71
-
79
+
72
80
  convenience init(endpoint: LightWalletEndpoint) {
73
81
  self.init(
74
82
  host: endpoint.host,
@@ -79,6 +87,16 @@ class LightWalletGRPCService {
79
87
  )
80
88
  }
81
89
 
90
+ convenience init(endpoint: LightWalletEndpoint, torURL: URL) {
91
+ self.init(
92
+ host: endpoint.host,
93
+ port: endpoint.port,
94
+ secure: endpoint.secure,
95
+ singleCallTimeout: endpoint.singleCallTimeoutInMillis,
96
+ streamingCallTimeout: endpoint.streamingCallTimeoutInMillis
97
+ )
98
+ }
99
+
82
100
  /// Inits a connection to a Lightwalletd service to the given
83
101
  /// - Parameters:
84
102
  /// - host: the hostname of the lightwalletd server
@@ -98,34 +116,56 @@ class LightWalletGRPCService {
98
116
  self.streamingCallTimeout = TimeLimit.timeout(.milliseconds(streamingCallTimeout))
99
117
  self.singleCallTimeout = TimeLimit.timeout(.milliseconds(singleCallTimeout))
100
118
 
119
+ self.host = host
120
+ self.port = port
121
+ self.secure = secure
122
+ }
123
+
124
+ deinit {
125
+ _ = channel?.close()
126
+ _ = compactTxStreamer.channel.close()
127
+ }
128
+
129
+ func resolveLazyConnect() -> CompactTxStreamerAsyncClient {
130
+ guard self.channel == nil else {
131
+ if let compactTxStreamerInternal {
132
+ return compactTxStreamerInternal
133
+ } else {
134
+ fatalError("Initialization of CompactTxStreamerAsyncClient failed")
135
+ }
136
+ }
137
+
101
138
  let connectionBuilder = secure ?
102
139
  ClientConnection.usingPlatformAppropriateTLS(for: NIOTSEventLoopGroup(loopCount: 1, defaultQoS: .default)) :
103
140
  ClientConnection.insecure(group: NIOTSEventLoopGroup(loopCount: 1, defaultQoS: .default))
104
-
141
+
105
142
  let channel = connectionBuilder
106
143
  .withConnectivityStateDelegate(connectionManager, executingOn: queue)
107
144
  .connect(host: host, port: port)
108
145
 
109
146
  self.channel = channel
110
-
111
- compactTxStreamer = CompactTxStreamerAsyncClient(
112
- channel: self.channel,
147
+
148
+ let compactTxStreamerInstance = CompactTxStreamerAsyncClient(
149
+ channel: channel,
113
150
  defaultCallOptions: Self.callOptions(
114
151
  timeLimit: self.singleCallTimeout
115
152
  )
116
153
  )
117
- }
118
-
119
- deinit {
120
- _ = channel.close()
121
- _ = compactTxStreamer.channel.close()
154
+
155
+ self.compactTxStreamerInternal = compactTxStreamerInstance
156
+
157
+ return compactTxStreamerInstance
122
158
  }
123
159
 
124
160
  func stop() {
125
- _ = channel.close()
161
+ _ = channel?.close()
126
162
  }
127
163
 
128
- func latestBlock() async throws -> BlockID {
164
+ func latestBlock(mode: ServiceMode) async throws -> BlockID {
165
+ guard mode == .direct else {
166
+ throw ZcashError.grpcServiceCalledWithTorMode
167
+ }
168
+
129
169
  do {
130
170
  return try await compactTxStreamer.getLatestBlock(ChainSpec())
131
171
  } catch {
@@ -144,12 +184,12 @@ class LightWalletGRPCService {
144
184
  cacheable: false
145
185
  )
146
186
  }
147
- }
148
187
 
149
- // MARK: - LightWalletService
150
-
151
- extension LightWalletGRPCService: LightWalletService {
152
- func getInfo() async throws -> LightWalletdInfo {
188
+ func getInfo(mode: ServiceMode) async throws -> LightWalletdInfo {
189
+ guard mode == .direct else {
190
+ throw ZcashError.grpcServiceCalledWithTorMode
191
+ }
192
+
153
193
  do {
154
194
  return try await compactTxStreamer.getLightdInfo(Empty())
155
195
  } catch {
@@ -157,12 +197,20 @@ extension LightWalletGRPCService: LightWalletService {
157
197
  throw ZcashError.serviceGetInfoFailed(serviceError)
158
198
  }
159
199
  }
160
-
161
- func latestBlockHeight() async throws -> BlockHeight {
162
- try await latestBlockHeightProvider.latestBlockHeight(streamer: compactTxStreamer)
200
+
201
+ func latestBlockHeight(mode: ServiceMode) async throws -> BlockHeight {
202
+ guard mode == .direct else {
203
+ throw ZcashError.grpcServiceCalledWithTorMode
204
+ }
205
+
206
+ return try await latestBlockHeightProvider.latestBlockHeight(streamer: compactTxStreamer)
163
207
  }
164
-
165
- func blockRange(_ range: CompactBlockRange) -> AsyncThrowingStream<ZcashCompactBlock, Error> {
208
+
209
+ func blockRange(_ range: CompactBlockRange, mode: ServiceMode) throws -> AsyncThrowingStream<ZcashCompactBlock, Error> {
210
+ guard mode == .direct else {
211
+ throw ZcashError.grpcServiceCalledWithTorMode
212
+ }
213
+
166
214
  let stream = compactTxStreamer.getBlockRange(range.blockRange())
167
215
  var iterator = stream.makeAsyncIterator()
168
216
 
@@ -176,8 +224,12 @@ extension LightWalletGRPCService: LightWalletService {
176
224
  }
177
225
  }
178
226
  }
179
-
180
- func submit(spendTransaction: Data) async throws -> LightWalletServiceResponse {
227
+
228
+ func submit(spendTransaction: Data, mode: ServiceMode) async throws -> LightWalletServiceResponse {
229
+ guard mode == .direct else {
230
+ throw ZcashError.grpcServiceCalledWithTorMode
231
+ }
232
+
181
233
  do {
182
234
  let transaction = RawTransaction.with { $0.data = spendTransaction }
183
235
  return try await compactTxStreamer.sendTransaction(transaction)
@@ -186,8 +238,12 @@ extension LightWalletGRPCService: LightWalletService {
186
238
  throw ZcashError.serviceSubmitFailed(serviceError)
187
239
  }
188
240
  }
189
-
190
- func fetchTransaction(txId: Data) async throws -> (tx: ZcashTransaction.Fetched?, status: TransactionStatus) {
241
+
242
+ func fetchTransaction(txId: Data, mode: ServiceMode) async throws -> (tx: ZcashTransaction.Fetched?, status: TransactionStatus) {
243
+ guard mode == .direct else {
244
+ throw ZcashError.grpcServiceCalledWithTorMode
245
+ }
246
+
191
247
  var txFilter = TxFilter()
192
248
  txFilter.hash = txId
193
249
 
@@ -206,11 +262,15 @@ extension LightWalletGRPCService: LightWalletService {
206
262
  status: isNotMined ? .notInMainChain : .mined(Int(rawTx.height))
207
263
  )
208
264
  } catch let error as GRPCStatus {
265
+ let noMempoolMsg = "No such mempool or blockchain transaction. Use gettransaction for wallet transactions."
266
+
209
267
  if error.makeGRPCStatus().code == .notFound {
210
268
  return (tx: nil, .txidNotRecognized)
211
269
  } else if let notFound = error.message?.contains("Transaction not found"), notFound {
212
270
  return (tx: nil, .txidNotRecognized)
213
- } else if let notFound = error.message?.contains("No such mempool or blockchain transaction. Use gettransaction for wallet transactions."), notFound {
271
+ } else if let notFound = error.message?.contains("No such mempool or main chain transaction"), notFound {
272
+ return (tx: nil, .txidNotRecognized)
273
+ } else if let notFound = error.message?.contains(noMempoolMsg), notFound {
214
274
  return (tx: nil, .txidNotRecognized)
215
275
  } else {
216
276
  let serviceError = error.mapToServiceError()
@@ -222,14 +282,23 @@ extension LightWalletGRPCService: LightWalletService {
222
282
  }
223
283
  }
224
284
 
225
- func fetchUTXOs(for tAddress: String, height: BlockHeight) -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error> {
226
- return fetchUTXOs(for: [tAddress], height: height)
285
+ func fetchUTXOs(for tAddress: String, height: BlockHeight, mode: ServiceMode) throws -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error> {
286
+ guard mode == .direct else {
287
+ throw ZcashError.grpcServiceCalledWithTorMode
288
+ }
289
+
290
+ return try fetchUTXOs(for: [tAddress], height: height, mode: mode)
227
291
  }
228
292
 
229
293
  func fetchUTXOs(
230
294
  for tAddresses: [String],
231
- height: BlockHeight
232
- ) -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error> {
295
+ height: BlockHeight,
296
+ mode: ServiceMode
297
+ ) throws -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error> {
298
+ guard mode == .direct else {
299
+ throw ZcashError.grpcServiceCalledWithTorMode
300
+ }
301
+
233
302
  guard !tAddresses.isEmpty else {
234
303
  return AsyncThrowingStream { continuation in continuation.finish() }
235
304
  }
@@ -261,8 +330,13 @@ extension LightWalletGRPCService: LightWalletService {
261
330
 
262
331
  func blockStream(
263
332
  startHeight: BlockHeight,
264
- endHeight: BlockHeight
265
- ) -> AsyncThrowingStream<ZcashCompactBlock, Error> {
333
+ endHeight: BlockHeight,
334
+ mode: ServiceMode
335
+ ) throws -> AsyncThrowingStream<ZcashCompactBlock, Error> {
336
+ guard mode == .direct else {
337
+ throw ZcashError.grpcServiceCalledWithTorMode
338
+ }
339
+
266
340
  let stream = compactTxStreamer.getBlockRange(
267
341
  BlockRange(
268
342
  startHeight: startHeight,
@@ -283,7 +357,26 @@ extension LightWalletGRPCService: LightWalletService {
283
357
  }
284
358
  }
285
359
 
286
- func getSubtreeRoots(_ request: GetSubtreeRootsArg) -> AsyncThrowingStream<SubtreeRoot, Error> {
360
+ func getMempoolStream() throws -> AsyncThrowingStream<RawTransaction, Error> {
361
+ let stream = compactTxStreamer.getMempoolStream(Empty())
362
+ var iterator = stream.makeAsyncIterator()
363
+
364
+ return AsyncThrowingStream() {
365
+ do {
366
+ guard let rawTransaction = try await iterator.next() else { return nil }
367
+ return rawTransaction
368
+ } catch {
369
+ let serviceError = error.mapToServiceError()
370
+ throw ZcashError.serviceGetMempoolStreamFailed(serviceError)
371
+ }
372
+ }
373
+ }
374
+
375
+ func getSubtreeRoots(_ request: GetSubtreeRootsArg, mode: ServiceMode) throws -> AsyncThrowingStream<SubtreeRoot, Error> {
376
+ guard mode == .direct else {
377
+ throw ZcashError.grpcServiceCalledWithTorMode
378
+ }
379
+
287
380
  let stream = compactTxStreamer.getSubtreeRoots(request)
288
381
  var iterator = stream.makeAsyncIterator()
289
382
 
@@ -298,11 +391,19 @@ extension LightWalletGRPCService: LightWalletService {
298
391
  }
299
392
  }
300
393
 
301
- func getTreeState(_ id: BlockID) async throws -> TreeState {
302
- try await compactTxStreamer.getTreeState(id)
394
+ func getTreeState(_ id: BlockID, mode: ServiceMode) async throws -> TreeState {
395
+ guard mode == .direct else {
396
+ throw ZcashError.grpcServiceCalledWithTorMode
397
+ }
398
+
399
+ return try await compactTxStreamer.getTreeState(id)
303
400
  }
304
401
 
305
- func getTaddressTxids(_ request: TransparentAddressBlockFilter) -> AsyncThrowingStream<RawTransaction, Error> {
402
+ func getTaddressTxids(_ request: TransparentAddressBlockFilter, mode: ServiceMode) throws -> AsyncThrowingStream<RawTransaction, Error> {
403
+ guard mode == .direct else {
404
+ throw ZcashError.grpcServiceCalledWithTorMode
405
+ }
406
+
306
407
  let stream = compactTxStreamer.getTaddressTxids(request)
307
408
  var iterator = stream.makeAsyncIterator()
308
409
 
@@ -317,8 +418,39 @@ extension LightWalletGRPCService: LightWalletService {
317
418
  }
318
419
  }
319
420
 
320
- func closeConnection() {
321
- _ = channel.close()
421
+ func checkSingleUseTransparentAddresses(
422
+ dbData: (String, UInt),
423
+ networkType: NetworkType,
424
+ accountUUID: AccountUUID,
425
+ mode: ServiceMode
426
+ ) async throws -> TransparentAddressCheckResult {
427
+ .torRequired
428
+ }
429
+
430
+ // swiftlint:disable:next function_parameter_count
431
+ func updateTransparentAddressTransactions(
432
+ address: String,
433
+ start: BlockHeight,
434
+ end: BlockHeight,
435
+ dbData: (String, UInt),
436
+ networkType: NetworkType,
437
+ mode: ServiceMode
438
+ ) async throws -> TransparentAddressCheckResult {
439
+ .torRequired
440
+ }
441
+
442
+ func fetchUTXOsByAddress(
443
+ address: String,
444
+ dbData: (String, UInt),
445
+ networkType: NetworkType,
446
+ accountUUID: AccountUUID,
447
+ mode: ServiceMode
448
+ ) async throws -> TransparentAddressCheckResult {
449
+ .torRequired
450
+ }
451
+
452
+ func closeConnections() async {
453
+ _ = channel?.close()
322
454
  }
323
455
  }
324
456
 
@@ -24,7 +24,7 @@ public enum LightWalletServiceError: Error {
24
24
  }
25
25
 
26
26
  extension LightWalletServiceError: Equatable {
27
- // swiftlint:disable cyclomatic_complexity
27
+ // swiftlint:disable:next cyclomatic_complexity
28
28
  public static func == (lhs: Self, rhs: Self) -> Bool {
29
29
  switch lhs {
30
30
  case .generalError(let message):
@@ -142,62 +142,109 @@ struct LightWalletServiceFactory {
142
142
  }
143
143
  }
144
144
 
145
+ /// Mode that determines which connection is used for the lightwalletd networking calls.
146
+ enum ServiceMode: Equatable {
147
+ /// Default Tor connection is used, lives for the lifetime of the Synchronizer.
148
+ case defaultTor
149
+ /// GRPC connection is used, no Tor involved.
150
+ case direct
151
+ /// Tor connection is used tagged by a given group name (String). Tags are held in memory for the lifetime of the Synchronizer.
152
+ case torInGroup(String)
153
+ /// Tor connection is used, each time a new one, not held in memory, used only once.
154
+ case uniqueTor
155
+
156
+ /// Helper method that generates a tagged group for a given transaction ID with a prefix.
157
+ static func txIdGroup(prefix: String, txId: Data) -> ServiceMode {
158
+ torInGroup("\(prefix)-\(txId.hexEncodedString())")
159
+ }
160
+ }
161
+
145
162
  protocol LightWalletService: AnyObject {
146
163
  /// Closure which is called when connection state changes.
147
164
  var connectionStateChange: ((_ from: ConnectionState, _ to: ConnectionState) -> Void)? { get set }
148
165
 
149
166
  /// Returns the info for this lightwalletd server
150
167
  /// - Throws: `serviceGetInfoFailed` when GRPC call fails.
151
- func getInfo() async throws -> LightWalletdInfo
168
+ func getInfo(mode: ServiceMode) async throws -> LightWalletdInfo
152
169
 
153
170
  /// - Throws: `serviceLatestBlockHeightFailed` when GRPC call fails.
154
- func latestBlock() async throws -> BlockID
171
+ func latestBlock(mode: ServiceMode) async throws -> BlockID
155
172
 
156
173
  /// Return the latest block height known to the service.
157
174
  /// - Throws: `serviceLatestBlockFailed` when GRPC call fails.
158
- func latestBlockHeight() async throws -> BlockHeight
175
+ func latestBlockHeight(mode: ServiceMode) async throws -> BlockHeight
159
176
 
160
177
  /// Return the given range of blocks.
161
178
  /// - Parameter range: the inclusive range to fetch.
162
179
  /// For instance if 1..5 is given, then every block in that will be fetched, including 1 and 5.
163
180
  /// - Throws: `serviceBlockRangeFailed` when GRPC call fails.
164
- func blockRange(_ range: CompactBlockRange) -> AsyncThrowingStream<ZcashCompactBlock, Error>
181
+ func blockRange(_ range: CompactBlockRange, mode: ServiceMode) throws -> AsyncThrowingStream<ZcashCompactBlock, Error>
165
182
 
166
183
  /// Submits a raw transaction over lightwalletd.
167
184
  /// - Parameter spendTransaction: data representing the transaction to be sent
168
185
  /// - Throws: `serviceSubmitFailed` when GRPC call fails.
169
- func submit(spendTransaction: Data) async throws -> LightWalletServiceResponse
170
-
186
+ func submit(spendTransaction: Data, mode: ServiceMode) async throws -> LightWalletServiceResponse
187
+
171
188
  /// Gets a transaction by id
172
189
  /// - Parameter txId: data representing the transaction ID
173
190
  /// - Throws: LightWalletServiceError
174
191
  /// - Returns: LightWalletServiceResponse
175
192
  /// - Throws: `serviceFetchTransactionFailed` when GRPC call fails.
176
- func fetchTransaction(txId: Data) async throws -> (tx: ZcashTransaction.Fetched?, status: TransactionStatus)
193
+ func fetchTransaction(txId: Data, mode: ServiceMode) async throws -> (tx: ZcashTransaction.Fetched?, status: TransactionStatus)
177
194
 
178
195
  /// - Throws: `serviceFetchUTXOsFailed` when GRPC call fails.
179
196
  // sourcery: mockedName="fetchUTXOsSingle"
180
- func fetchUTXOs(for tAddress: String, height: BlockHeight) -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error>
197
+ func fetchUTXOs(for tAddress: String, height: BlockHeight, mode: ServiceMode) throws -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error>
181
198
 
182
199
  /// - Throws: `serviceFetchUTXOsFailed` when GRPC call fails.
183
- func fetchUTXOs(for tAddresses: [String], height: BlockHeight) -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error>
200
+ func fetchUTXOs(for tAddresses: [String], height: BlockHeight, mode: ServiceMode) throws -> AsyncThrowingStream<UnspentTransactionOutputEntity, Error>
184
201
 
185
202
  /// - Throws: `serviceBlockStreamFailed` when GRPC call fails.
186
203
  func blockStream(
187
204
  startHeight: BlockHeight,
188
- endHeight: BlockHeight
189
- ) -> AsyncThrowingStream<ZcashCompactBlock, Error>
205
+ endHeight: BlockHeight,
206
+ mode: ServiceMode
207
+ ) throws -> AsyncThrowingStream<ZcashCompactBlock, Error>
190
208
 
191
- func closeConnection()
209
+ /// Used for potential closure of channels or connections.
210
+ /// Example:` LightWalletGRPCServiceOverTor` inherits `LightWalletService` and closes Tor connections.
211
+ func closeConnections() async
192
212
 
193
213
  /// Returns a stream of information about roots of subtrees of the Sapling and Orchard
194
214
  /// note commitment trees.
195
215
  ///
196
216
  /// - Parameters:
197
217
  /// - request: Request to send to GetSubtreeRoots.
198
- func getSubtreeRoots(_ request: GetSubtreeRootsArg) -> AsyncThrowingStream<SubtreeRoot, Error>
218
+ func getSubtreeRoots(_ request: GetSubtreeRootsArg, mode: ServiceMode) throws -> AsyncThrowingStream<SubtreeRoot, Error>
199
219
 
200
- func getTreeState(_ id: BlockID) async throws -> TreeState
220
+ func getTreeState(_ id: BlockID, mode: ServiceMode) async throws -> TreeState
221
+
222
+ func getTaddressTxids(_ request: TransparentAddressBlockFilter, mode: ServiceMode) throws -> AsyncThrowingStream<RawTransaction, Error>
223
+
224
+ func getMempoolStream() throws -> AsyncThrowingStream<RawTransaction, Error>
225
+
226
+ func checkSingleUseTransparentAddresses(
227
+ dbData: (String, UInt),
228
+ networkType: NetworkType,
229
+ accountUUID: AccountUUID,
230
+ mode: ServiceMode
231
+ ) async throws -> TransparentAddressCheckResult
232
+
233
+ // swiftlint:disable:next function_parameter_count
234
+ func updateTransparentAddressTransactions(
235
+ address: String,
236
+ start: BlockHeight,
237
+ end: BlockHeight,
238
+ dbData: (String, UInt),
239
+ networkType: NetworkType,
240
+ mode: ServiceMode
241
+ ) async throws -> TransparentAddressCheckResult
201
242
 
202
- func getTaddressTxids(_ request: TransparentAddressBlockFilter) -> AsyncThrowingStream<RawTransaction, Error>
243
+ func fetchUTXOsByAddress(
244
+ address: String,
245
+ dbData: (String, UInt),
246
+ networkType: NetworkType,
247
+ accountUUID: AccountUUID,
248
+ mode: ServiceMode
249
+ ) async throws -> TransparentAddressCheckResult
203
250
  }