react-native-zcash 0.9.13 → 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 (275) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/android/build.gradle +6 -6
  3. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3130000.json +8 -0
  4. package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +126 -69
  5. package/ios/RNZcash.m +0 -5
  6. package/ios/RNZcash.swift +153 -104
  7. package/ios/ZCashLightClientKit/Account/Account.swift +48 -0
  8. package/ios/ZCashLightClientKit/Account/AccountMetadataKey.swift +96 -0
  9. package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +23 -4
  10. package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +6 -2
  11. package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +4 -2
  12. package/ios/ZCashLightClientKit/Block/Actions/ValidateServerAction.swift +4 -1
  13. package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +83 -16
  14. package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +4 -2
  15. package/ios/ZCashLightClientKit/Block/Download/BlockDownloaderService.swift +22 -19
  16. package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +50 -19
  17. package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +5 -3
  18. package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +22 -5
  19. package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +2 -1
  20. package/ios/ZCashLightClientKit/Block/Utils/CompactBlockProgress.swift +5 -3
  21. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +88 -0
  22. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSource.swift +4 -0
  23. package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +52 -21
  24. package/ios/ZCashLightClientKit/CombineSynchronizer.swift +49 -27
  25. package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +8 -2
  26. package/ios/ZCashLightClientKit/DAO/BlockDao.swift +65 -0
  27. package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +86 -1
  28. package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +4 -4
  29. package/ios/ZCashLightClientKit/Entity/Pczt.swift +10 -0
  30. package/ios/ZCashLightClientKit/Entity/SentNoteEntity.swift +2 -2
  31. package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +40 -16
  32. package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +1 -1
  33. package/ios/ZCashLightClientKit/Error/ZcashError.swift +182 -14
  34. package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +63 -5
  35. package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +122 -12
  36. package/ios/ZCashLightClientKit/Initializer.swift +49 -14
  37. package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +15 -6
  38. package/ios/ZCashLightClientKit/Model/SingleUseTransparentAddress.swift +29 -0
  39. package/ios/ZCashLightClientKit/Model/TransactionDataRequest.swift +83 -2
  40. package/ios/ZCashLightClientKit/Model/WalletSummary.swift +21 -4
  41. package/ios/ZCashLightClientKit/Model/WalletTypes.swift +38 -8
  42. package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +177 -45
  43. package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +63 -16
  44. package/ios/ZCashLightClientKit/Modules/Service/Tor/LightWalletGRPCServiceOverTor.swift +273 -0
  45. package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +5 -2
  46. package/ios/ZCashLightClientKit/Repository/TransactionRepository.swift +2 -0
  47. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2675000.json +8 -0
  48. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2677500.json +8 -0
  49. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2682500.json +8 -0
  50. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2685000.json +8 -0
  51. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2687500.json +8 -0
  52. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2692500.json +8 -0
  53. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2695000.json +8 -0
  54. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2697500.json +8 -0
  55. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2702500.json +8 -0
  56. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2705000.json +8 -0
  57. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2707500.json +8 -0
  58. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2712500.json +8 -0
  59. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2715000.json +8 -0
  60. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2717500.json +8 -0
  61. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2722500.json +8 -0
  62. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2725000.json +8 -0
  63. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2727500.json +8 -0
  64. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2732500.json +8 -0
  65. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2735000.json +8 -0
  66. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2737500.json +8 -0
  67. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2742500.json +8 -0
  68. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2745000.json +8 -0
  69. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2747500.json +8 -0
  70. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2752500.json +8 -0
  71. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2755000.json +8 -0
  72. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2757500.json +8 -0
  73. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2762500.json +8 -0
  74. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2765000.json +8 -0
  75. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2767500.json +8 -0
  76. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2772500.json +8 -0
  77. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2775000.json +8 -0
  78. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2777500.json +8 -0
  79. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2782500.json +8 -0
  80. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2785000.json +8 -0
  81. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2787500.json +8 -0
  82. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2792500.json +8 -0
  83. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2795000.json +8 -0
  84. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2797500.json +8 -0
  85. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2802500.json +8 -0
  86. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2805000.json +8 -0
  87. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2807500.json +8 -0
  88. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2812500.json +8 -0
  89. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2815000.json +8 -0
  90. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2817500.json +8 -0
  91. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2822500.json +8 -0
  92. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2825000.json +8 -0
  93. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2827500.json +8 -0
  94. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2832500.json +8 -0
  95. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2835000.json +8 -0
  96. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2837500.json +8 -0
  97. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2842500.json +8 -0
  98. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2845000.json +8 -0
  99. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2847500.json +8 -0
  100. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2852500.json +8 -0
  101. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2855000.json +8 -0
  102. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2857500.json +8 -0
  103. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2862500.json +8 -0
  104. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2865000.json +8 -0
  105. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2867500.json +8 -0
  106. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2872500.json +8 -0
  107. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2875000.json +8 -0
  108. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2877500.json +8 -0
  109. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2882500.json +8 -0
  110. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2885000.json +8 -0
  111. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2887500.json +8 -0
  112. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2892500.json +8 -0
  113. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2895000.json +8 -0
  114. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2897500.json +8 -0
  115. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2902500.json +8 -0
  116. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2905000.json +8 -0
  117. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2907500.json +8 -0
  118. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2912500.json +8 -0
  119. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2915000.json +8 -0
  120. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2917500.json +8 -0
  121. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2922500.json +8 -0
  122. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2925000.json +8 -0
  123. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2927500.json +8 -0
  124. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2932500.json +8 -0
  125. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2935000.json +8 -0
  126. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2937500.json +8 -0
  127. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2942500.json +8 -0
  128. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2945000.json +8 -0
  129. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2947500.json +8 -0
  130. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2952500.json +8 -0
  131. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2955000.json +8 -0
  132. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2957500.json +8 -0
  133. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2962500.json +8 -0
  134. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2965000.json +8 -0
  135. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2967500.json +8 -0
  136. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2972500.json +8 -0
  137. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2975000.json +8 -0
  138. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2977500.json +8 -0
  139. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2982500.json +8 -0
  140. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2985000.json +8 -0
  141. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2987500.json +8 -0
  142. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2992500.json +8 -0
  143. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2995000.json +8 -0
  144. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2997500.json +8 -0
  145. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3002500.json +8 -0
  146. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3005000.json +8 -0
  147. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3007500.json +8 -0
  148. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3012500.json +8 -0
  149. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3015000.json +8 -0
  150. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3017500.json +8 -0
  151. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3022500.json +8 -0
  152. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3025000.json +8 -0
  153. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3027500.json +8 -0
  154. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3032500.json +8 -0
  155. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3035000.json +8 -0
  156. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3037500.json +8 -0
  157. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3042500.json +8 -0
  158. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3045000.json +8 -0
  159. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3047500.json +8 -0
  160. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3052500.json +8 -0
  161. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3055000.json +8 -0
  162. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3057500.json +8 -0
  163. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3062500.json +8 -0
  164. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3065000.json +8 -0
  165. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3067500.json +8 -0
  166. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3072500.json +8 -0
  167. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3075000.json +8 -0
  168. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3077500.json +8 -0
  169. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3082500.json +8 -0
  170. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3085000.json +8 -0
  171. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3087500.json +8 -0
  172. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3092500.json +8 -0
  173. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3095000.json +8 -0
  174. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3097500.json +8 -0
  175. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3102500.json +8 -0
  176. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3105000.json +8 -0
  177. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3107500.json +8 -0
  178. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3112500.json +8 -0
  179. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3115000.json +8 -0
  180. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3117500.json +8 -0
  181. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3122500.json +8 -0
  182. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3125000.json +8 -0
  183. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3127500.json +8 -0
  184. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3130000.json +8 -0
  185. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3010000.json +8 -0
  186. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3020000.json +8 -0
  187. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3030000.json +8 -0
  188. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3040000.json +8 -0
  189. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3050000.json +8 -0
  190. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3060000.json +8 -0
  191. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3070000.json +8 -0
  192. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3080000.json +8 -0
  193. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3090000.json +8 -0
  194. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3100000.json +8 -0
  195. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3110000.json +8 -0
  196. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3120000.json +8 -0
  197. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3130000.json +8 -0
  198. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3140000.json +8 -0
  199. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3150000.json +8 -0
  200. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3160000.json +8 -0
  201. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3170000.json +8 -0
  202. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3180000.json +8 -0
  203. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3190000.json +8 -0
  204. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3200000.json +8 -0
  205. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3210000.json +8 -0
  206. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3220000.json +8 -0
  207. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3230000.json +8 -0
  208. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3240000.json +8 -0
  209. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3250000.json +8 -0
  210. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3260000.json +8 -0
  211. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3270000.json +8 -0
  212. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3280000.json +8 -0
  213. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3290000.json +8 -0
  214. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3300000.json +8 -0
  215. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3310000.json +8 -0
  216. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3320000.json +8 -0
  217. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3330000.json +8 -0
  218. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3340000.json +8 -0
  219. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3350000.json +8 -0
  220. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3360000.json +8 -0
  221. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3370000.json +8 -0
  222. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3380000.json +8 -0
  223. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3390000.json +8 -0
  224. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3400000.json +8 -0
  225. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3410000.json +8 -0
  226. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3420000.json +8 -0
  227. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3430000.json +8 -0
  228. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3440000.json +8 -0
  229. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3450000.json +8 -0
  230. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3460000.json +8 -0
  231. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3470000.json +8 -0
  232. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3480000.json +8 -0
  233. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3490000.json +8 -0
  234. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3500000.json +8 -0
  235. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3510000.json +8 -0
  236. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3520000.json +8 -0
  237. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3530000.json +8 -0
  238. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3540000.json +8 -0
  239. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3550000.json +8 -0
  240. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3560000.json +8 -0
  241. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3570000.json +8 -0
  242. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3580000.json +8 -0
  243. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3590000.json +8 -0
  244. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3600000.json +8 -0
  245. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3610000.json +8 -0
  246. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3620000.json +8 -0
  247. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3630000.json +8 -0
  248. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3640000.json +8 -0
  249. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3650000.json +8 -0
  250. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3660000.json +8 -0
  251. package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3670000.json +8 -0
  252. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +89 -10
  253. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackendWelding.swift +39 -3
  254. package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +532 -74
  255. package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +97 -14
  256. package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +104 -28
  257. package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +105 -31
  258. package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +36 -9
  259. package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +401 -175
  260. package/ios/ZCashLightClientKit/Synchronizer.swift +192 -69
  261. package/ios/ZCashLightClientKit/Tool/DerivationTool.swift +69 -12
  262. package/ios/ZCashLightClientKit/Tor/TorClient.swift +502 -11
  263. package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +10 -6
  264. package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +24 -9
  265. package/ios/ZCashLightClientKit/Utils/SDKFlags.swift +71 -0
  266. package/ios/libzcashlc.xcframework/Info.plist +5 -5
  267. package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
  268. package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
  269. package/ios/zcashlc.h +1640 -378
  270. package/lib/rnzcash.rn.js.map +1 -1
  271. package/lib/src/react-native.d.ts +2 -2
  272. package/lib/src/types.d.ts +2 -0
  273. package/package.json +1 -1
  274. package/src/react-native.ts +2 -3
  275. package/src/types.ts +2 -0
@@ -12,6 +12,7 @@ class WalletTransactionEncoder: TransactionEncoder {
12
12
  let rustBackend: ZcashRustBackendWelding
13
13
  let repository: TransactionRepository
14
14
  let logger: Logger
15
+ let sdkFlags: SDKFlags
15
16
 
16
17
  private let outputParamsURL: URL
17
18
  private let spendParamsURL: URL
@@ -28,7 +29,8 @@ class WalletTransactionEncoder: TransactionEncoder {
28
29
  outputParams: URL,
29
30
  spendParams: URL,
30
31
  networkType: NetworkType,
31
- logger: Logger
32
+ logger: Logger,
33
+ sdkFlags: SDKFlags
32
34
  ) {
33
35
  self.rustBackend = rustBackend
34
36
  self.dataDbURL = dataDb
@@ -39,9 +41,12 @@ class WalletTransactionEncoder: TransactionEncoder {
39
41
  self.spendParamsURL = spendParams
40
42
  self.networkType = networkType
41
43
  self.logger = logger
44
+ self.sdkFlags = sdkFlags
42
45
  }
43
46
 
44
47
  convenience init(initializer: Initializer) {
48
+ let sdkFlags = initializer.container.resolve(SDKFlags.self)
49
+
45
50
  self.init(
46
51
  rustBackend: initializer.rustBackend,
47
52
  dataDb: initializer.dataDbURL,
@@ -51,18 +56,19 @@ class WalletTransactionEncoder: TransactionEncoder {
51
56
  outputParams: initializer.outputParamsURL,
52
57
  spendParams: initializer.spendParamsURL,
53
58
  networkType: initializer.network.networkType,
54
- logger: initializer.logger
59
+ logger: initializer.logger,
60
+ sdkFlags: sdkFlags
55
61
  )
56
62
  }
57
63
 
58
64
  func proposeTransfer(
59
- accountIndex: Int,
65
+ accountUUID: AccountUUID,
60
66
  recipient: String,
61
67
  amount: Zatoshi,
62
68
  memoBytes: MemoBytes?
63
69
  ) async throws -> Proposal {
64
70
  let proposal = try await rustBackend.proposeTransfer(
65
- account: Int32(accountIndex),
71
+ accountUUID: accountUUID,
66
72
  to: recipient,
67
73
  value: amount.amount,
68
74
  memo: memoBytes
@@ -72,13 +78,13 @@ class WalletTransactionEncoder: TransactionEncoder {
72
78
  }
73
79
 
74
80
  func proposeShielding(
75
- accountIndex: Int,
81
+ accountUUID: AccountUUID,
76
82
  shieldingThreshold: Zatoshi,
77
83
  memoBytes: MemoBytes?,
78
84
  transparentReceiver: String? = nil
79
85
  ) async throws -> Proposal? {
80
86
  guard let proposal = try await rustBackend.proposeShielding(
81
- account: Int32(accountIndex),
87
+ accountUUID: accountUUID,
82
88
  memo: memoBytes,
83
89
  shieldingThreshold: shieldingThreshold,
84
90
  transparentReceiver: transparentReceiver
@@ -89,11 +95,11 @@ class WalletTransactionEncoder: TransactionEncoder {
89
95
 
90
96
  func proposeFulfillingPaymentFromURI(
91
97
  _ uri: String,
92
- accountIndex: Int
98
+ accountUUID: AccountUUID
93
99
  ) async throws -> Proposal {
94
100
  let proposal = try await rustBackend.proposeTransferFromURI(
95
101
  uri,
96
- account: Int32(accountIndex)
102
+ accountUUID: accountUUID
97
103
  )
98
104
  return Proposal(inner: proposal)
99
105
  }
@@ -111,6 +117,10 @@ class WalletTransactionEncoder: TransactionEncoder {
111
117
  usk: spendingKey
112
118
  )
113
119
 
120
+ return try await fetchTransactionsForTxIds(txIds)
121
+ }
122
+
123
+ func fetchTransactionsForTxIds(_ txIds: [Data]) async throws -> [ZcashTransaction.Overview] {
114
124
  logger.debug("transaction ids: \(txIds)")
115
125
 
116
126
  var txs: [ZcashTransaction.Overview] = []
@@ -125,7 +135,12 @@ class WalletTransactionEncoder: TransactionEncoder {
125
135
  func submit(
126
136
  transaction: EncodedTransaction
127
137
  ) async throws {
128
- let response = try await self.lightWalletService.submit(spendTransaction: transaction.raw)
138
+ let response = try await self.lightWalletService.submit(
139
+ spendTransaction: transaction.raw,
140
+ mode: await sdkFlags.torEnabled
141
+ ? ServiceMode.txIdGroup(prefix: "submit", txId: transaction.transactionId)
142
+ : ServiceMode.direct
143
+ )
129
144
 
130
145
  guard response.errorCode >= 0 else {
131
146
  throw TransactionEncoderError.submitError(code: Int(response.errorCode), message: response.errorMessage)
@@ -0,0 +1,71 @@
1
+ //
2
+ // SDKFlags.swift
3
+ // ZcashLightClientKit
4
+ //
5
+ // Created by Lukáš Korba on 2025-07-18.
6
+ //
7
+
8
+ /// A singleton actor with control flags for the SDK.
9
+ actor SDKFlags {
10
+ /// `torEnabled` controls `SeviceMode` for the connection to the `LightWalletService`.
11
+ /// When disabled, the `ServiceMode.direct` (GRPC) is enforced.
12
+ /// When enabled, all Tor cases in `ServiceMode` are allowed.
13
+ /// Accessible only internally inside the SDK to control the connection
14
+ var torEnabled: Bool
15
+
16
+ /// `exchangeRateEnabled` controls whether fetch of exnchage rate is enabled or disabled.
17
+ /// When enabled, the `TorClient` is initialized but is not used for lwdService calls.
18
+ var exchangeRateEnabled: Bool
19
+
20
+ /// This flag communicates state of initialization of `TorClient`
21
+ /// `nil` = the attempt to initialize `TorClient` hasn't been initiated
22
+ /// `false` = initialization of `TorClient` failed
23
+ /// `true` = initialization of `TorClient` succeeded
24
+ var torClientInitializationSuccessfullyDone: Bool?
25
+
26
+ /// Runtime helper flag used to mark whether chainTip CBP action has been done.
27
+ var chainTipUpdated = false
28
+
29
+ init(
30
+ torEnabled: Bool,
31
+ exchangeRateEnabled: Bool
32
+ ) {
33
+ self.torEnabled = torEnabled
34
+ self.exchangeRateEnabled = exchangeRateEnabled
35
+ }
36
+
37
+ /// Helper method that wraps the decision logic for `ServiceMode`.
38
+ /// When Tor is not enabled, it always must use fallback to `.direct` mode.
39
+ func ifTor(_ serviceMode: ServiceMode) -> ServiceMode {
40
+ torEnabled ? serviceMode : .direct
41
+ }
42
+
43
+ /// Use to update the `torEnabled` flag
44
+ func torFlagUpdate(_ newFlag: Bool) {
45
+ torEnabled = newFlag
46
+ }
47
+
48
+ // Use to update the `exchangeRateEnabled` flag
49
+ func exchangeRateFlagUpdate(_ newFlag: Bool) {
50
+ exchangeRateEnabled = newFlag
51
+ }
52
+
53
+ /// Use to update the `torClientInitializationSuccessfullyDone` flag
54
+ func torClientInitializationSuccessfullyDoneFlagUpdate(_ newFlag: Bool?) {
55
+ torClientInitializationSuccessfullyDone = newFlag
56
+ }
57
+
58
+ /// Use to update the `chainTipUpdated` flag
59
+ func markChainTipAsUpdated() {
60
+ chainTipUpdated = true
61
+ }
62
+
63
+ /// The client using the SDK called `stop()`, for example when the app is about to enter the background lifecycle.
64
+ /// Use this to reset or update any relevant flags if needed.
65
+ func sdkStopped() {
66
+ // The SDK is stopped, so there will be a gap before the next start (doesn’t matter whether it’s a cold or foreground start).
67
+ // The chain tip might be old enough to cause issues when attempting to send or shield funds before the next chain tip update call finishes.
68
+ // Therefore, it is reset here.
69
+ chainTipUpdated = false
70
+ }
71
+ }
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libzcashlc.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
11
+ <string>ios-arm64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libzcashlc.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
- <string>x86_64</string>
18
17
  </array>
19
18
  <key>SupportedPlatform</key>
20
19
  <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
23
20
  </dict>
24
21
  <dict>
25
22
  <key>BinaryPath</key>
26
23
  <string>libzcashlc.a</string>
27
24
  <key>LibraryIdentifier</key>
28
- <string>ios-arm64</string>
25
+ <string>ios-arm64_x86_64-simulator</string>
29
26
  <key>LibraryPath</key>
30
27
  <string>libzcashlc.a</string>
31
28
  <key>SupportedArchitectures</key>
32
29
  <array>
33
30
  <string>arm64</string>
31
+ <string>x86_64</string>
34
32
  </array>
35
33
  <key>SupportedPlatform</key>
36
34
  <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>