react-native-zcash 0.8.1 → 0.9.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 (118) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/android/build.gradle +3 -3
  3. package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2650000.json +8 -0
  4. package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +15 -25
  5. package/ios/RNZcash.m +3 -5
  6. package/ios/RNZcash.swift +42 -23
  7. package/ios/ZCashLightClientKit/Block/Actions/Action.swift +1 -0
  8. package/ios/ZCashLightClientKit/Block/Actions/EnhanceAction.swift +1 -1
  9. package/ios/ZCashLightClientKit/Block/Actions/ProcessSuggestedScanRangesAction.swift +1 -1
  10. package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +1 -1
  11. package/ios/ZCashLightClientKit/Block/Actions/TxResubmissionAction.swift +75 -0
  12. package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +1 -1
  13. package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +3 -1
  14. package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +14 -0
  15. package/ios/ZCashLightClientKit/Block/Download/BlockDownloaderService.swift +2 -2
  16. package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +54 -49
  17. package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +1 -6
  18. package/ios/ZCashLightClientKit/Checkpoint/CheckpointSourceFactory.swift +1 -1
  19. package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +3 -1
  20. package/ios/ZCashLightClientKit/CombineSynchronizer.swift +6 -2
  21. package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +15 -0
  22. package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +20 -4
  23. package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +27 -24
  24. package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +2 -2
  25. package/ios/ZCashLightClientKit/Error/ZcashError.swift +32 -1
  26. package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +11 -1
  27. package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +18 -0
  28. package/ios/ZCashLightClientKit/Initializer.swift +22 -14
  29. package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +0 -1
  30. package/ios/ZCashLightClientKit/Model/FiatCurrencyResult.swift +25 -0
  31. package/ios/ZCashLightClientKit/Model/Proposal.swift +1 -1
  32. package/ios/ZCashLightClientKit/Model/TransactionDataRequest.swift +26 -0
  33. package/ios/ZCashLightClientKit/Model/WalletTypes.swift +39 -1
  34. package/ios/ZCashLightClientKit/Model/Zatoshi.swift +1 -1
  35. package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +39 -2
  36. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proto/service.proto +5 -4
  37. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/service.grpc.swift +819 -3
  38. package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/service.pb.swift +2 -2
  39. package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +3 -1
  40. package/ios/ZCashLightClientKit/Providers/ResourceProvider.swift +10 -0
  41. package/ios/ZCashLightClientKit/Repository/TransactionRepository.swift +4 -0
  42. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2475000.json +8 -0
  43. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2477500.json +8 -0
  44. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2482500.json +8 -0
  45. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2485000.json +8 -0
  46. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2487500.json +8 -0
  47. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2492500.json +8 -0
  48. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2495000.json +8 -0
  49. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2497500.json +8 -0
  50. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2502500.json +8 -0
  51. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2505000.json +8 -0
  52. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2507500.json +8 -0
  53. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2512500.json +8 -0
  54. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2515000.json +8 -0
  55. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2517500.json +8 -0
  56. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2522500.json +8 -0
  57. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2525000.json +8 -0
  58. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2527500.json +8 -0
  59. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2532500.json +8 -0
  60. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2535000.json +8 -0
  61. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2537500.json +8 -0
  62. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2542500.json +8 -0
  63. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2545000.json +8 -0
  64. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2547500.json +8 -0
  65. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2552500.json +8 -0
  66. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2555000.json +8 -0
  67. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2557500.json +8 -0
  68. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2562500.json +8 -0
  69. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2565000.json +8 -0
  70. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2567500.json +8 -0
  71. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2572500.json +8 -0
  72. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2575000.json +8 -0
  73. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2577500.json +8 -0
  74. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2582500.json +8 -0
  75. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2585000.json +8 -0
  76. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2587500.json +8 -0
  77. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2592500.json +8 -0
  78. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2595000.json +8 -0
  79. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2597500.json +8 -0
  80. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2602500.json +8 -0
  81. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2605000.json +8 -0
  82. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2607500.json +8 -0
  83. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2612500.json +8 -0
  84. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2615000.json +8 -0
  85. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2617500.json +8 -0
  86. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2622500.json +8 -0
  87. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2625000.json +8 -0
  88. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2627500.json +8 -0
  89. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2632500.json +8 -0
  90. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2635000.json +8 -0
  91. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2637500.json +8 -0
  92. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2642500.json +8 -0
  93. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2645000.json +8 -0
  94. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2647500.json +8 -0
  95. package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2650000.json +8 -0
  96. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +4 -24
  97. package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackendWelding.swift +0 -15
  98. package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +133 -32
  99. package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +18 -1
  100. package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +4 -0
  101. package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +5 -1
  102. package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +53 -3
  103. package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +236 -7
  104. package/ios/ZCashLightClientKit/Synchronizer.swift +28 -0
  105. package/ios/ZCashLightClientKit/Tool/DerivationTool.swift +29 -5
  106. package/ios/ZCashLightClientKit/Tor/TorClient.swift +57 -0
  107. package/ios/ZCashLightClientKit/Utils/LoggingProxy.swift +4 -0
  108. package/ios/ZCashLightClientKit/Utils/OSLogger.swift +4 -0
  109. package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
  110. package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
  111. package/ios/zcashlc.h +287 -42
  112. package/lib/rnzcash.rn.js +8 -8
  113. package/lib/rnzcash.rn.js.map +1 -1
  114. package/lib/src/react-native.d.ts +3 -3
  115. package/lib/src/types.d.ts +4 -2
  116. package/package.json +1 -1
  117. package/src/react-native.ts +13 -18
  118. package/src/types.ts +5 -2
@@ -255,7 +255,8 @@ extension CompactTxStreamerClientProtocol {
255
255
  )
256
256
  }
257
257
 
258
- /// Return the txids corresponding to the given t-address within the given block range
258
+ /// Return the transactions corresponding to the given t-address within the given block range
259
+ /// NB - this method is misnamed, it returns transactions, not transaction IDs.
259
260
  ///
260
261
  /// - Parameters:
261
262
  /// - request: Request to send to GetTaddressTxids.
@@ -402,8 +403,8 @@ extension CompactTxStreamerClientProtocol {
402
403
  )
403
404
  }
404
405
 
405
- /// Returns a stream of information about roots of subtrees of the Sapling and Orchard
406
- /// note commitment trees.
406
+ /// Returns a stream of information about roots of subtrees of the note commitment tree
407
+ /// for the specified shielded protocol (Sapling or Orchard).
407
408
  ///
408
409
  /// - Parameters:
409
410
  /// - request: Request to send to GetSubtreeRoots.
@@ -1358,3 +1359,818 @@ internal enum CompactTxStreamerClientMetadata {
1358
1359
  }
1359
1360
  }
1360
1361
 
1362
+ /// To build a server, implement a class that conforms to this protocol.
1363
+ internal protocol CompactTxStreamerProvider: CallHandlerProvider {
1364
+ var interceptors: CompactTxStreamerServerInterceptorFactoryProtocol? { get }
1365
+
1366
+ /// Return the height of the tip of the best chain
1367
+ func getLatestBlock(request: ChainSpec, context: StatusOnlyCallContext) -> EventLoopFuture<BlockID>
1368
+
1369
+ /// Return the compact block corresponding to the given block identifier
1370
+ func getBlock(request: BlockID, context: StatusOnlyCallContext) -> EventLoopFuture<CompactBlock>
1371
+
1372
+ /// Same as GetBlock except actions contain only nullifiers
1373
+ func getBlockNullifiers(request: BlockID, context: StatusOnlyCallContext) -> EventLoopFuture<CompactBlock>
1374
+
1375
+ /// Return a list of consecutive compact blocks
1376
+ func getBlockRange(request: BlockRange, context: StreamingResponseCallContext<CompactBlock>) -> EventLoopFuture<GRPCStatus>
1377
+
1378
+ /// Same as GetBlockRange except actions contain only nullifiers
1379
+ func getBlockRangeNullifiers(request: BlockRange, context: StreamingResponseCallContext<CompactBlock>) -> EventLoopFuture<GRPCStatus>
1380
+
1381
+ /// Return the requested full (not compact) transaction (as from zcashd)
1382
+ func getTransaction(request: TxFilter, context: StatusOnlyCallContext) -> EventLoopFuture<RawTransaction>
1383
+
1384
+ /// Submit the given transaction to the Zcash network
1385
+ func sendTransaction(request: RawTransaction, context: StatusOnlyCallContext) -> EventLoopFuture<SendResponse>
1386
+
1387
+ /// Return the transactions corresponding to the given t-address within the given block range
1388
+ /// NB - this method is misnamed, it returns transactions, not transaction IDs.
1389
+ func getTaddressTxids(request: TransparentAddressBlockFilter, context: StreamingResponseCallContext<RawTransaction>) -> EventLoopFuture<GRPCStatus>
1390
+
1391
+ func getTaddressBalance(request: AddressList, context: StatusOnlyCallContext) -> EventLoopFuture<Balance>
1392
+
1393
+ func getTaddressBalanceStream(context: UnaryResponseCallContext<Balance>) -> EventLoopFuture<(StreamEvent<Address>) -> Void>
1394
+
1395
+ /// Return the compact transactions currently in the mempool; the results
1396
+ /// can be a few seconds out of date. If the Exclude list is empty, return
1397
+ /// all transactions; otherwise return all *except* those in the Exclude list
1398
+ /// (if any); this allows the client to avoid receiving transactions that it
1399
+ /// already has (from an earlier call to this rpc). The transaction IDs in the
1400
+ /// Exclude list can be shortened to any number of bytes to make the request
1401
+ /// more bandwidth-efficient; if two or more transactions in the mempool
1402
+ /// match a shortened txid, they are all sent (none is excluded). Transactions
1403
+ /// in the exclude list that don't exist in the mempool are ignored.
1404
+ func getMempoolTx(request: Exclude, context: StreamingResponseCallContext<CompactTx>) -> EventLoopFuture<GRPCStatus>
1405
+
1406
+ /// Return a stream of current Mempool transactions. This will keep the output stream open while
1407
+ /// there are mempool transactions. It will close the returned stream when a new block is mined.
1408
+ func getMempoolStream(request: Empty, context: StreamingResponseCallContext<RawTransaction>) -> EventLoopFuture<GRPCStatus>
1409
+
1410
+ /// GetTreeState returns the note commitment tree state corresponding to the given block.
1411
+ /// See section 3.7 of the Zcash protocol specification. It returns several other useful
1412
+ /// values also (even though they can be obtained using GetBlock).
1413
+ /// The block can be specified by either height or hash.
1414
+ func getTreeState(request: BlockID, context: StatusOnlyCallContext) -> EventLoopFuture<TreeState>
1415
+
1416
+ func getLatestTreeState(request: Empty, context: StatusOnlyCallContext) -> EventLoopFuture<TreeState>
1417
+
1418
+ /// Returns a stream of information about roots of subtrees of the note commitment tree
1419
+ /// for the specified shielded protocol (Sapling or Orchard).
1420
+ func getSubtreeRoots(request: GetSubtreeRootsArg, context: StreamingResponseCallContext<SubtreeRoot>) -> EventLoopFuture<GRPCStatus>
1421
+
1422
+ func getAddressUtxos(request: GetAddressUtxosArg, context: StatusOnlyCallContext) -> EventLoopFuture<GetAddressUtxosReplyList>
1423
+
1424
+ func getAddressUtxosStream(request: GetAddressUtxosArg, context: StreamingResponseCallContext<GetAddressUtxosReply>) -> EventLoopFuture<GRPCStatus>
1425
+
1426
+ /// Return information about this lightwalletd instance and the blockchain
1427
+ func getLightdInfo(request: Empty, context: StatusOnlyCallContext) -> EventLoopFuture<LightdInfo>
1428
+
1429
+ /// Testing-only, requires lightwalletd --ping-very-insecure (do not enable in production)
1430
+ func ping(request: Duration, context: StatusOnlyCallContext) -> EventLoopFuture<PingResponse>
1431
+ }
1432
+
1433
+ extension CompactTxStreamerProvider {
1434
+ internal var serviceName: Substring {
1435
+ return CompactTxStreamerServerMetadata.serviceDescriptor.fullName[...]
1436
+ }
1437
+
1438
+ /// Determines, calls and returns the appropriate request handler, depending on the request's method.
1439
+ /// Returns nil for methods not handled by this service.
1440
+ internal func handle(
1441
+ method name: Substring,
1442
+ context: CallHandlerContext
1443
+ ) -> GRPCServerHandlerProtocol? {
1444
+ switch name {
1445
+ case "GetLatestBlock":
1446
+ return UnaryServerHandler(
1447
+ context: context,
1448
+ requestDeserializer: ProtobufDeserializer<ChainSpec>(),
1449
+ responseSerializer: ProtobufSerializer<BlockID>(),
1450
+ interceptors: self.interceptors?.makeGetLatestBlockInterceptors() ?? [],
1451
+ userFunction: self.getLatestBlock(request:context:)
1452
+ )
1453
+
1454
+ case "GetBlock":
1455
+ return UnaryServerHandler(
1456
+ context: context,
1457
+ requestDeserializer: ProtobufDeserializer<BlockID>(),
1458
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1459
+ interceptors: self.interceptors?.makeGetBlockInterceptors() ?? [],
1460
+ userFunction: self.getBlock(request:context:)
1461
+ )
1462
+
1463
+ case "GetBlockNullifiers":
1464
+ return UnaryServerHandler(
1465
+ context: context,
1466
+ requestDeserializer: ProtobufDeserializer<BlockID>(),
1467
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1468
+ interceptors: self.interceptors?.makeGetBlockNullifiersInterceptors() ?? [],
1469
+ userFunction: self.getBlockNullifiers(request:context:)
1470
+ )
1471
+
1472
+ case "GetBlockRange":
1473
+ return ServerStreamingServerHandler(
1474
+ context: context,
1475
+ requestDeserializer: ProtobufDeserializer<BlockRange>(),
1476
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1477
+ interceptors: self.interceptors?.makeGetBlockRangeInterceptors() ?? [],
1478
+ userFunction: self.getBlockRange(request:context:)
1479
+ )
1480
+
1481
+ case "GetBlockRangeNullifiers":
1482
+ return ServerStreamingServerHandler(
1483
+ context: context,
1484
+ requestDeserializer: ProtobufDeserializer<BlockRange>(),
1485
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1486
+ interceptors: self.interceptors?.makeGetBlockRangeNullifiersInterceptors() ?? [],
1487
+ userFunction: self.getBlockRangeNullifiers(request:context:)
1488
+ )
1489
+
1490
+ case "GetTransaction":
1491
+ return UnaryServerHandler(
1492
+ context: context,
1493
+ requestDeserializer: ProtobufDeserializer<TxFilter>(),
1494
+ responseSerializer: ProtobufSerializer<RawTransaction>(),
1495
+ interceptors: self.interceptors?.makeGetTransactionInterceptors() ?? [],
1496
+ userFunction: self.getTransaction(request:context:)
1497
+ )
1498
+
1499
+ case "SendTransaction":
1500
+ return UnaryServerHandler(
1501
+ context: context,
1502
+ requestDeserializer: ProtobufDeserializer<RawTransaction>(),
1503
+ responseSerializer: ProtobufSerializer<SendResponse>(),
1504
+ interceptors: self.interceptors?.makeSendTransactionInterceptors() ?? [],
1505
+ userFunction: self.sendTransaction(request:context:)
1506
+ )
1507
+
1508
+ case "GetTaddressTxids":
1509
+ return ServerStreamingServerHandler(
1510
+ context: context,
1511
+ requestDeserializer: ProtobufDeserializer<TransparentAddressBlockFilter>(),
1512
+ responseSerializer: ProtobufSerializer<RawTransaction>(),
1513
+ interceptors: self.interceptors?.makeGetTaddressTxidsInterceptors() ?? [],
1514
+ userFunction: self.getTaddressTxids(request:context:)
1515
+ )
1516
+
1517
+ case "GetTaddressBalance":
1518
+ return UnaryServerHandler(
1519
+ context: context,
1520
+ requestDeserializer: ProtobufDeserializer<AddressList>(),
1521
+ responseSerializer: ProtobufSerializer<Balance>(),
1522
+ interceptors: self.interceptors?.makeGetTaddressBalanceInterceptors() ?? [],
1523
+ userFunction: self.getTaddressBalance(request:context:)
1524
+ )
1525
+
1526
+ case "GetTaddressBalanceStream":
1527
+ return ClientStreamingServerHandler(
1528
+ context: context,
1529
+ requestDeserializer: ProtobufDeserializer<Address>(),
1530
+ responseSerializer: ProtobufSerializer<Balance>(),
1531
+ interceptors: self.interceptors?.makeGetTaddressBalanceStreamInterceptors() ?? [],
1532
+ observerFactory: self.getTaddressBalanceStream(context:)
1533
+ )
1534
+
1535
+ case "GetMempoolTx":
1536
+ return ServerStreamingServerHandler(
1537
+ context: context,
1538
+ requestDeserializer: ProtobufDeserializer<Exclude>(),
1539
+ responseSerializer: ProtobufSerializer<CompactTx>(),
1540
+ interceptors: self.interceptors?.makeGetMempoolTxInterceptors() ?? [],
1541
+ userFunction: self.getMempoolTx(request:context:)
1542
+ )
1543
+
1544
+ case "GetMempoolStream":
1545
+ return ServerStreamingServerHandler(
1546
+ context: context,
1547
+ requestDeserializer: ProtobufDeserializer<Empty>(),
1548
+ responseSerializer: ProtobufSerializer<RawTransaction>(),
1549
+ interceptors: self.interceptors?.makeGetMempoolStreamInterceptors() ?? [],
1550
+ userFunction: self.getMempoolStream(request:context:)
1551
+ )
1552
+
1553
+ case "GetTreeState":
1554
+ return UnaryServerHandler(
1555
+ context: context,
1556
+ requestDeserializer: ProtobufDeserializer<BlockID>(),
1557
+ responseSerializer: ProtobufSerializer<TreeState>(),
1558
+ interceptors: self.interceptors?.makeGetTreeStateInterceptors() ?? [],
1559
+ userFunction: self.getTreeState(request:context:)
1560
+ )
1561
+
1562
+ case "GetLatestTreeState":
1563
+ return UnaryServerHandler(
1564
+ context: context,
1565
+ requestDeserializer: ProtobufDeserializer<Empty>(),
1566
+ responseSerializer: ProtobufSerializer<TreeState>(),
1567
+ interceptors: self.interceptors?.makeGetLatestTreeStateInterceptors() ?? [],
1568
+ userFunction: self.getLatestTreeState(request:context:)
1569
+ )
1570
+
1571
+ case "GetSubtreeRoots":
1572
+ return ServerStreamingServerHandler(
1573
+ context: context,
1574
+ requestDeserializer: ProtobufDeserializer<GetSubtreeRootsArg>(),
1575
+ responseSerializer: ProtobufSerializer<SubtreeRoot>(),
1576
+ interceptors: self.interceptors?.makeGetSubtreeRootsInterceptors() ?? [],
1577
+ userFunction: self.getSubtreeRoots(request:context:)
1578
+ )
1579
+
1580
+ case "GetAddressUtxos":
1581
+ return UnaryServerHandler(
1582
+ context: context,
1583
+ requestDeserializer: ProtobufDeserializer<GetAddressUtxosArg>(),
1584
+ responseSerializer: ProtobufSerializer<GetAddressUtxosReplyList>(),
1585
+ interceptors: self.interceptors?.makeGetAddressUtxosInterceptors() ?? [],
1586
+ userFunction: self.getAddressUtxos(request:context:)
1587
+ )
1588
+
1589
+ case "GetAddressUtxosStream":
1590
+ return ServerStreamingServerHandler(
1591
+ context: context,
1592
+ requestDeserializer: ProtobufDeserializer<GetAddressUtxosArg>(),
1593
+ responseSerializer: ProtobufSerializer<GetAddressUtxosReply>(),
1594
+ interceptors: self.interceptors?.makeGetAddressUtxosStreamInterceptors() ?? [],
1595
+ userFunction: self.getAddressUtxosStream(request:context:)
1596
+ )
1597
+
1598
+ case "GetLightdInfo":
1599
+ return UnaryServerHandler(
1600
+ context: context,
1601
+ requestDeserializer: ProtobufDeserializer<Empty>(),
1602
+ responseSerializer: ProtobufSerializer<LightdInfo>(),
1603
+ interceptors: self.interceptors?.makeGetLightdInfoInterceptors() ?? [],
1604
+ userFunction: self.getLightdInfo(request:context:)
1605
+ )
1606
+
1607
+ case "Ping":
1608
+ return UnaryServerHandler(
1609
+ context: context,
1610
+ requestDeserializer: ProtobufDeserializer<Duration>(),
1611
+ responseSerializer: ProtobufSerializer<PingResponse>(),
1612
+ interceptors: self.interceptors?.makePingInterceptors() ?? [],
1613
+ userFunction: self.ping(request:context:)
1614
+ )
1615
+
1616
+ default:
1617
+ return nil
1618
+ }
1619
+ }
1620
+ }
1621
+
1622
+ /// To implement a server, implement an object which conforms to this protocol.
1623
+ @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1624
+ internal protocol CompactTxStreamerAsyncProvider: CallHandlerProvider, Sendable {
1625
+ static var serviceDescriptor: GRPCServiceDescriptor { get }
1626
+ var interceptors: CompactTxStreamerServerInterceptorFactoryProtocol? { get }
1627
+
1628
+ /// Return the height of the tip of the best chain
1629
+ func getLatestBlock(
1630
+ request: ChainSpec,
1631
+ context: GRPCAsyncServerCallContext
1632
+ ) async throws -> BlockID
1633
+
1634
+ /// Return the compact block corresponding to the given block identifier
1635
+ func getBlock(
1636
+ request: BlockID,
1637
+ context: GRPCAsyncServerCallContext
1638
+ ) async throws -> CompactBlock
1639
+
1640
+ /// Same as GetBlock except actions contain only nullifiers
1641
+ func getBlockNullifiers(
1642
+ request: BlockID,
1643
+ context: GRPCAsyncServerCallContext
1644
+ ) async throws -> CompactBlock
1645
+
1646
+ /// Return a list of consecutive compact blocks
1647
+ func getBlockRange(
1648
+ request: BlockRange,
1649
+ responseStream: GRPCAsyncResponseStreamWriter<CompactBlock>,
1650
+ context: GRPCAsyncServerCallContext
1651
+ ) async throws
1652
+
1653
+ /// Same as GetBlockRange except actions contain only nullifiers
1654
+ func getBlockRangeNullifiers(
1655
+ request: BlockRange,
1656
+ responseStream: GRPCAsyncResponseStreamWriter<CompactBlock>,
1657
+ context: GRPCAsyncServerCallContext
1658
+ ) async throws
1659
+
1660
+ /// Return the requested full (not compact) transaction (as from zcashd)
1661
+ func getTransaction(
1662
+ request: TxFilter,
1663
+ context: GRPCAsyncServerCallContext
1664
+ ) async throws -> RawTransaction
1665
+
1666
+ /// Submit the given transaction to the Zcash network
1667
+ func sendTransaction(
1668
+ request: RawTransaction,
1669
+ context: GRPCAsyncServerCallContext
1670
+ ) async throws -> SendResponse
1671
+
1672
+ /// Return the transactions corresponding to the given t-address within the given block range
1673
+ /// NB - this method is misnamed, it returns transactions, not transaction IDs.
1674
+ func getTaddressTxids(
1675
+ request: TransparentAddressBlockFilter,
1676
+ responseStream: GRPCAsyncResponseStreamWriter<RawTransaction>,
1677
+ context: GRPCAsyncServerCallContext
1678
+ ) async throws
1679
+
1680
+ func getTaddressBalance(
1681
+ request: AddressList,
1682
+ context: GRPCAsyncServerCallContext
1683
+ ) async throws -> Balance
1684
+
1685
+ func getTaddressBalanceStream(
1686
+ requestStream: GRPCAsyncRequestStream<Address>,
1687
+ context: GRPCAsyncServerCallContext
1688
+ ) async throws -> Balance
1689
+
1690
+ /// Return the compact transactions currently in the mempool; the results
1691
+ /// can be a few seconds out of date. If the Exclude list is empty, return
1692
+ /// all transactions; otherwise return all *except* those in the Exclude list
1693
+ /// (if any); this allows the client to avoid receiving transactions that it
1694
+ /// already has (from an earlier call to this rpc). The transaction IDs in the
1695
+ /// Exclude list can be shortened to any number of bytes to make the request
1696
+ /// more bandwidth-efficient; if two or more transactions in the mempool
1697
+ /// match a shortened txid, they are all sent (none is excluded). Transactions
1698
+ /// in the exclude list that don't exist in the mempool are ignored.
1699
+ func getMempoolTx(
1700
+ request: Exclude,
1701
+ responseStream: GRPCAsyncResponseStreamWriter<CompactTx>,
1702
+ context: GRPCAsyncServerCallContext
1703
+ ) async throws
1704
+
1705
+ /// Return a stream of current Mempool transactions. This will keep the output stream open while
1706
+ /// there are mempool transactions. It will close the returned stream when a new block is mined.
1707
+ func getMempoolStream(
1708
+ request: Empty,
1709
+ responseStream: GRPCAsyncResponseStreamWriter<RawTransaction>,
1710
+ context: GRPCAsyncServerCallContext
1711
+ ) async throws
1712
+
1713
+ /// GetTreeState returns the note commitment tree state corresponding to the given block.
1714
+ /// See section 3.7 of the Zcash protocol specification. It returns several other useful
1715
+ /// values also (even though they can be obtained using GetBlock).
1716
+ /// The block can be specified by either height or hash.
1717
+ func getTreeState(
1718
+ request: BlockID,
1719
+ context: GRPCAsyncServerCallContext
1720
+ ) async throws -> TreeState
1721
+
1722
+ func getLatestTreeState(
1723
+ request: Empty,
1724
+ context: GRPCAsyncServerCallContext
1725
+ ) async throws -> TreeState
1726
+
1727
+ /// Returns a stream of information about roots of subtrees of the note commitment tree
1728
+ /// for the specified shielded protocol (Sapling or Orchard).
1729
+ func getSubtreeRoots(
1730
+ request: GetSubtreeRootsArg,
1731
+ responseStream: GRPCAsyncResponseStreamWriter<SubtreeRoot>,
1732
+ context: GRPCAsyncServerCallContext
1733
+ ) async throws
1734
+
1735
+ func getAddressUtxos(
1736
+ request: GetAddressUtxosArg,
1737
+ context: GRPCAsyncServerCallContext
1738
+ ) async throws -> GetAddressUtxosReplyList
1739
+
1740
+ func getAddressUtxosStream(
1741
+ request: GetAddressUtxosArg,
1742
+ responseStream: GRPCAsyncResponseStreamWriter<GetAddressUtxosReply>,
1743
+ context: GRPCAsyncServerCallContext
1744
+ ) async throws
1745
+
1746
+ /// Return information about this lightwalletd instance and the blockchain
1747
+ func getLightdInfo(
1748
+ request: Empty,
1749
+ context: GRPCAsyncServerCallContext
1750
+ ) async throws -> LightdInfo
1751
+
1752
+ /// Testing-only, requires lightwalletd --ping-very-insecure (do not enable in production)
1753
+ func ping(
1754
+ request: Duration,
1755
+ context: GRPCAsyncServerCallContext
1756
+ ) async throws -> PingResponse
1757
+ }
1758
+
1759
+ @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1760
+ extension CompactTxStreamerAsyncProvider {
1761
+ internal static var serviceDescriptor: GRPCServiceDescriptor {
1762
+ return CompactTxStreamerServerMetadata.serviceDescriptor
1763
+ }
1764
+
1765
+ internal var serviceName: Substring {
1766
+ return CompactTxStreamerServerMetadata.serviceDescriptor.fullName[...]
1767
+ }
1768
+
1769
+ internal var interceptors: CompactTxStreamerServerInterceptorFactoryProtocol? {
1770
+ return nil
1771
+ }
1772
+
1773
+ internal func handle(
1774
+ method name: Substring,
1775
+ context: CallHandlerContext
1776
+ ) -> GRPCServerHandlerProtocol? {
1777
+ switch name {
1778
+ case "GetLatestBlock":
1779
+ return GRPCAsyncServerHandler(
1780
+ context: context,
1781
+ requestDeserializer: ProtobufDeserializer<ChainSpec>(),
1782
+ responseSerializer: ProtobufSerializer<BlockID>(),
1783
+ interceptors: self.interceptors?.makeGetLatestBlockInterceptors() ?? [],
1784
+ wrapping: { try await self.getLatestBlock(request: $0, context: $1) }
1785
+ )
1786
+
1787
+ case "GetBlock":
1788
+ return GRPCAsyncServerHandler(
1789
+ context: context,
1790
+ requestDeserializer: ProtobufDeserializer<BlockID>(),
1791
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1792
+ interceptors: self.interceptors?.makeGetBlockInterceptors() ?? [],
1793
+ wrapping: { try await self.getBlock(request: $0, context: $1) }
1794
+ )
1795
+
1796
+ case "GetBlockNullifiers":
1797
+ return GRPCAsyncServerHandler(
1798
+ context: context,
1799
+ requestDeserializer: ProtobufDeserializer<BlockID>(),
1800
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1801
+ interceptors: self.interceptors?.makeGetBlockNullifiersInterceptors() ?? [],
1802
+ wrapping: { try await self.getBlockNullifiers(request: $0, context: $1) }
1803
+ )
1804
+
1805
+ case "GetBlockRange":
1806
+ return GRPCAsyncServerHandler(
1807
+ context: context,
1808
+ requestDeserializer: ProtobufDeserializer<BlockRange>(),
1809
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1810
+ interceptors: self.interceptors?.makeGetBlockRangeInterceptors() ?? [],
1811
+ wrapping: { try await self.getBlockRange(request: $0, responseStream: $1, context: $2) }
1812
+ )
1813
+
1814
+ case "GetBlockRangeNullifiers":
1815
+ return GRPCAsyncServerHandler(
1816
+ context: context,
1817
+ requestDeserializer: ProtobufDeserializer<BlockRange>(),
1818
+ responseSerializer: ProtobufSerializer<CompactBlock>(),
1819
+ interceptors: self.interceptors?.makeGetBlockRangeNullifiersInterceptors() ?? [],
1820
+ wrapping: { try await self.getBlockRangeNullifiers(request: $0, responseStream: $1, context: $2) }
1821
+ )
1822
+
1823
+ case "GetTransaction":
1824
+ return GRPCAsyncServerHandler(
1825
+ context: context,
1826
+ requestDeserializer: ProtobufDeserializer<TxFilter>(),
1827
+ responseSerializer: ProtobufSerializer<RawTransaction>(),
1828
+ interceptors: self.interceptors?.makeGetTransactionInterceptors() ?? [],
1829
+ wrapping: { try await self.getTransaction(request: $0, context: $1) }
1830
+ )
1831
+
1832
+ case "SendTransaction":
1833
+ return GRPCAsyncServerHandler(
1834
+ context: context,
1835
+ requestDeserializer: ProtobufDeserializer<RawTransaction>(),
1836
+ responseSerializer: ProtobufSerializer<SendResponse>(),
1837
+ interceptors: self.interceptors?.makeSendTransactionInterceptors() ?? [],
1838
+ wrapping: { try await self.sendTransaction(request: $0, context: $1) }
1839
+ )
1840
+
1841
+ case "GetTaddressTxids":
1842
+ return GRPCAsyncServerHandler(
1843
+ context: context,
1844
+ requestDeserializer: ProtobufDeserializer<TransparentAddressBlockFilter>(),
1845
+ responseSerializer: ProtobufSerializer<RawTransaction>(),
1846
+ interceptors: self.interceptors?.makeGetTaddressTxidsInterceptors() ?? [],
1847
+ wrapping: { try await self.getTaddressTxids(request: $0, responseStream: $1, context: $2) }
1848
+ )
1849
+
1850
+ case "GetTaddressBalance":
1851
+ return GRPCAsyncServerHandler(
1852
+ context: context,
1853
+ requestDeserializer: ProtobufDeserializer<AddressList>(),
1854
+ responseSerializer: ProtobufSerializer<Balance>(),
1855
+ interceptors: self.interceptors?.makeGetTaddressBalanceInterceptors() ?? [],
1856
+ wrapping: { try await self.getTaddressBalance(request: $0, context: $1) }
1857
+ )
1858
+
1859
+ case "GetTaddressBalanceStream":
1860
+ return GRPCAsyncServerHandler(
1861
+ context: context,
1862
+ requestDeserializer: ProtobufDeserializer<Address>(),
1863
+ responseSerializer: ProtobufSerializer<Balance>(),
1864
+ interceptors: self.interceptors?.makeGetTaddressBalanceStreamInterceptors() ?? [],
1865
+ wrapping: { try await self.getTaddressBalanceStream(requestStream: $0, context: $1) }
1866
+ )
1867
+
1868
+ case "GetMempoolTx":
1869
+ return GRPCAsyncServerHandler(
1870
+ context: context,
1871
+ requestDeserializer: ProtobufDeserializer<Exclude>(),
1872
+ responseSerializer: ProtobufSerializer<CompactTx>(),
1873
+ interceptors: self.interceptors?.makeGetMempoolTxInterceptors() ?? [],
1874
+ wrapping: { try await self.getMempoolTx(request: $0, responseStream: $1, context: $2) }
1875
+ )
1876
+
1877
+ case "GetMempoolStream":
1878
+ return GRPCAsyncServerHandler(
1879
+ context: context,
1880
+ requestDeserializer: ProtobufDeserializer<Empty>(),
1881
+ responseSerializer: ProtobufSerializer<RawTransaction>(),
1882
+ interceptors: self.interceptors?.makeGetMempoolStreamInterceptors() ?? [],
1883
+ wrapping: { try await self.getMempoolStream(request: $0, responseStream: $1, context: $2) }
1884
+ )
1885
+
1886
+ case "GetTreeState":
1887
+ return GRPCAsyncServerHandler(
1888
+ context: context,
1889
+ requestDeserializer: ProtobufDeserializer<BlockID>(),
1890
+ responseSerializer: ProtobufSerializer<TreeState>(),
1891
+ interceptors: self.interceptors?.makeGetTreeStateInterceptors() ?? [],
1892
+ wrapping: { try await self.getTreeState(request: $0, context: $1) }
1893
+ )
1894
+
1895
+ case "GetLatestTreeState":
1896
+ return GRPCAsyncServerHandler(
1897
+ context: context,
1898
+ requestDeserializer: ProtobufDeserializer<Empty>(),
1899
+ responseSerializer: ProtobufSerializer<TreeState>(),
1900
+ interceptors: self.interceptors?.makeGetLatestTreeStateInterceptors() ?? [],
1901
+ wrapping: { try await self.getLatestTreeState(request: $0, context: $1) }
1902
+ )
1903
+
1904
+ case "GetSubtreeRoots":
1905
+ return GRPCAsyncServerHandler(
1906
+ context: context,
1907
+ requestDeserializer: ProtobufDeserializer<GetSubtreeRootsArg>(),
1908
+ responseSerializer: ProtobufSerializer<SubtreeRoot>(),
1909
+ interceptors: self.interceptors?.makeGetSubtreeRootsInterceptors() ?? [],
1910
+ wrapping: { try await self.getSubtreeRoots(request: $0, responseStream: $1, context: $2) }
1911
+ )
1912
+
1913
+ case "GetAddressUtxos":
1914
+ return GRPCAsyncServerHandler(
1915
+ context: context,
1916
+ requestDeserializer: ProtobufDeserializer<GetAddressUtxosArg>(),
1917
+ responseSerializer: ProtobufSerializer<GetAddressUtxosReplyList>(),
1918
+ interceptors: self.interceptors?.makeGetAddressUtxosInterceptors() ?? [],
1919
+ wrapping: { try await self.getAddressUtxos(request: $0, context: $1) }
1920
+ )
1921
+
1922
+ case "GetAddressUtxosStream":
1923
+ return GRPCAsyncServerHandler(
1924
+ context: context,
1925
+ requestDeserializer: ProtobufDeserializer<GetAddressUtxosArg>(),
1926
+ responseSerializer: ProtobufSerializer<GetAddressUtxosReply>(),
1927
+ interceptors: self.interceptors?.makeGetAddressUtxosStreamInterceptors() ?? [],
1928
+ wrapping: { try await self.getAddressUtxosStream(request: $0, responseStream: $1, context: $2) }
1929
+ )
1930
+
1931
+ case "GetLightdInfo":
1932
+ return GRPCAsyncServerHandler(
1933
+ context: context,
1934
+ requestDeserializer: ProtobufDeserializer<Empty>(),
1935
+ responseSerializer: ProtobufSerializer<LightdInfo>(),
1936
+ interceptors: self.interceptors?.makeGetLightdInfoInterceptors() ?? [],
1937
+ wrapping: { try await self.getLightdInfo(request: $0, context: $1) }
1938
+ )
1939
+
1940
+ case "Ping":
1941
+ return GRPCAsyncServerHandler(
1942
+ context: context,
1943
+ requestDeserializer: ProtobufDeserializer<Duration>(),
1944
+ responseSerializer: ProtobufSerializer<PingResponse>(),
1945
+ interceptors: self.interceptors?.makePingInterceptors() ?? [],
1946
+ wrapping: { try await self.ping(request: $0, context: $1) }
1947
+ )
1948
+
1949
+ default:
1950
+ return nil
1951
+ }
1952
+ }
1953
+ }
1954
+
1955
+ internal protocol CompactTxStreamerServerInterceptorFactoryProtocol: Sendable {
1956
+
1957
+ /// - Returns: Interceptors to use when handling 'getLatestBlock'.
1958
+ /// Defaults to calling `self.makeInterceptors()`.
1959
+ func makeGetLatestBlockInterceptors() -> [ServerInterceptor<ChainSpec, BlockID>]
1960
+
1961
+ /// - Returns: Interceptors to use when handling 'getBlock'.
1962
+ /// Defaults to calling `self.makeInterceptors()`.
1963
+ func makeGetBlockInterceptors() -> [ServerInterceptor<BlockID, CompactBlock>]
1964
+
1965
+ /// - Returns: Interceptors to use when handling 'getBlockNullifiers'.
1966
+ /// Defaults to calling `self.makeInterceptors()`.
1967
+ func makeGetBlockNullifiersInterceptors() -> [ServerInterceptor<BlockID, CompactBlock>]
1968
+
1969
+ /// - Returns: Interceptors to use when handling 'getBlockRange'.
1970
+ /// Defaults to calling `self.makeInterceptors()`.
1971
+ func makeGetBlockRangeInterceptors() -> [ServerInterceptor<BlockRange, CompactBlock>]
1972
+
1973
+ /// - Returns: Interceptors to use when handling 'getBlockRangeNullifiers'.
1974
+ /// Defaults to calling `self.makeInterceptors()`.
1975
+ func makeGetBlockRangeNullifiersInterceptors() -> [ServerInterceptor<BlockRange, CompactBlock>]
1976
+
1977
+ /// - Returns: Interceptors to use when handling 'getTransaction'.
1978
+ /// Defaults to calling `self.makeInterceptors()`.
1979
+ func makeGetTransactionInterceptors() -> [ServerInterceptor<TxFilter, RawTransaction>]
1980
+
1981
+ /// - Returns: Interceptors to use when handling 'sendTransaction'.
1982
+ /// Defaults to calling `self.makeInterceptors()`.
1983
+ func makeSendTransactionInterceptors() -> [ServerInterceptor<RawTransaction, SendResponse>]
1984
+
1985
+ /// - Returns: Interceptors to use when handling 'getTaddressTxids'.
1986
+ /// Defaults to calling `self.makeInterceptors()`.
1987
+ func makeGetTaddressTxidsInterceptors() -> [ServerInterceptor<TransparentAddressBlockFilter, RawTransaction>]
1988
+
1989
+ /// - Returns: Interceptors to use when handling 'getTaddressBalance'.
1990
+ /// Defaults to calling `self.makeInterceptors()`.
1991
+ func makeGetTaddressBalanceInterceptors() -> [ServerInterceptor<AddressList, Balance>]
1992
+
1993
+ /// - Returns: Interceptors to use when handling 'getTaddressBalanceStream'.
1994
+ /// Defaults to calling `self.makeInterceptors()`.
1995
+ func makeGetTaddressBalanceStreamInterceptors() -> [ServerInterceptor<Address, Balance>]
1996
+
1997
+ /// - Returns: Interceptors to use when handling 'getMempoolTx'.
1998
+ /// Defaults to calling `self.makeInterceptors()`.
1999
+ func makeGetMempoolTxInterceptors() -> [ServerInterceptor<Exclude, CompactTx>]
2000
+
2001
+ /// - Returns: Interceptors to use when handling 'getMempoolStream'.
2002
+ /// Defaults to calling `self.makeInterceptors()`.
2003
+ func makeGetMempoolStreamInterceptors() -> [ServerInterceptor<Empty, RawTransaction>]
2004
+
2005
+ /// - Returns: Interceptors to use when handling 'getTreeState'.
2006
+ /// Defaults to calling `self.makeInterceptors()`.
2007
+ func makeGetTreeStateInterceptors() -> [ServerInterceptor<BlockID, TreeState>]
2008
+
2009
+ /// - Returns: Interceptors to use when handling 'getLatestTreeState'.
2010
+ /// Defaults to calling `self.makeInterceptors()`.
2011
+ func makeGetLatestTreeStateInterceptors() -> [ServerInterceptor<Empty, TreeState>]
2012
+
2013
+ /// - Returns: Interceptors to use when handling 'getSubtreeRoots'.
2014
+ /// Defaults to calling `self.makeInterceptors()`.
2015
+ func makeGetSubtreeRootsInterceptors() -> [ServerInterceptor<GetSubtreeRootsArg, SubtreeRoot>]
2016
+
2017
+ /// - Returns: Interceptors to use when handling 'getAddressUtxos'.
2018
+ /// Defaults to calling `self.makeInterceptors()`.
2019
+ func makeGetAddressUtxosInterceptors() -> [ServerInterceptor<GetAddressUtxosArg, GetAddressUtxosReplyList>]
2020
+
2021
+ /// - Returns: Interceptors to use when handling 'getAddressUtxosStream'.
2022
+ /// Defaults to calling `self.makeInterceptors()`.
2023
+ func makeGetAddressUtxosStreamInterceptors() -> [ServerInterceptor<GetAddressUtxosArg, GetAddressUtxosReply>]
2024
+
2025
+ /// - Returns: Interceptors to use when handling 'getLightdInfo'.
2026
+ /// Defaults to calling `self.makeInterceptors()`.
2027
+ func makeGetLightdInfoInterceptors() -> [ServerInterceptor<Empty, LightdInfo>]
2028
+
2029
+ /// - Returns: Interceptors to use when handling 'ping'.
2030
+ /// Defaults to calling `self.makeInterceptors()`.
2031
+ func makePingInterceptors() -> [ServerInterceptor<Duration, PingResponse>]
2032
+ }
2033
+
2034
+ internal enum CompactTxStreamerServerMetadata {
2035
+ internal static let serviceDescriptor = GRPCServiceDescriptor(
2036
+ name: "CompactTxStreamer",
2037
+ fullName: "cash.z.wallet.sdk.rpc.CompactTxStreamer",
2038
+ methods: [
2039
+ CompactTxStreamerServerMetadata.Methods.getLatestBlock,
2040
+ CompactTxStreamerServerMetadata.Methods.getBlock,
2041
+ CompactTxStreamerServerMetadata.Methods.getBlockNullifiers,
2042
+ CompactTxStreamerServerMetadata.Methods.getBlockRange,
2043
+ CompactTxStreamerServerMetadata.Methods.getBlockRangeNullifiers,
2044
+ CompactTxStreamerServerMetadata.Methods.getTransaction,
2045
+ CompactTxStreamerServerMetadata.Methods.sendTransaction,
2046
+ CompactTxStreamerServerMetadata.Methods.getTaddressTxids,
2047
+ CompactTxStreamerServerMetadata.Methods.getTaddressBalance,
2048
+ CompactTxStreamerServerMetadata.Methods.getTaddressBalanceStream,
2049
+ CompactTxStreamerServerMetadata.Methods.getMempoolTx,
2050
+ CompactTxStreamerServerMetadata.Methods.getMempoolStream,
2051
+ CompactTxStreamerServerMetadata.Methods.getTreeState,
2052
+ CompactTxStreamerServerMetadata.Methods.getLatestTreeState,
2053
+ CompactTxStreamerServerMetadata.Methods.getSubtreeRoots,
2054
+ CompactTxStreamerServerMetadata.Methods.getAddressUtxos,
2055
+ CompactTxStreamerServerMetadata.Methods.getAddressUtxosStream,
2056
+ CompactTxStreamerServerMetadata.Methods.getLightdInfo,
2057
+ CompactTxStreamerServerMetadata.Methods.ping,
2058
+ ]
2059
+ )
2060
+
2061
+ internal enum Methods {
2062
+ internal static let getLatestBlock = GRPCMethodDescriptor(
2063
+ name: "GetLatestBlock",
2064
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock",
2065
+ type: GRPCCallType.unary
2066
+ )
2067
+
2068
+ internal static let getBlock = GRPCMethodDescriptor(
2069
+ name: "GetBlock",
2070
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock",
2071
+ type: GRPCCallType.unary
2072
+ )
2073
+
2074
+ internal static let getBlockNullifiers = GRPCMethodDescriptor(
2075
+ name: "GetBlockNullifiers",
2076
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockNullifiers",
2077
+ type: GRPCCallType.unary
2078
+ )
2079
+
2080
+ internal static let getBlockRange = GRPCMethodDescriptor(
2081
+ name: "GetBlockRange",
2082
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange",
2083
+ type: GRPCCallType.serverStreaming
2084
+ )
2085
+
2086
+ internal static let getBlockRangeNullifiers = GRPCMethodDescriptor(
2087
+ name: "GetBlockRangeNullifiers",
2088
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRangeNullifiers",
2089
+ type: GRPCCallType.serverStreaming
2090
+ )
2091
+
2092
+ internal static let getTransaction = GRPCMethodDescriptor(
2093
+ name: "GetTransaction",
2094
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction",
2095
+ type: GRPCCallType.unary
2096
+ )
2097
+
2098
+ internal static let sendTransaction = GRPCMethodDescriptor(
2099
+ name: "SendTransaction",
2100
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction",
2101
+ type: GRPCCallType.unary
2102
+ )
2103
+
2104
+ internal static let getTaddressTxids = GRPCMethodDescriptor(
2105
+ name: "GetTaddressTxids",
2106
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressTxids",
2107
+ type: GRPCCallType.serverStreaming
2108
+ )
2109
+
2110
+ internal static let getTaddressBalance = GRPCMethodDescriptor(
2111
+ name: "GetTaddressBalance",
2112
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressBalance",
2113
+ type: GRPCCallType.unary
2114
+ )
2115
+
2116
+ internal static let getTaddressBalanceStream = GRPCMethodDescriptor(
2117
+ name: "GetTaddressBalanceStream",
2118
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressBalanceStream",
2119
+ type: GRPCCallType.clientStreaming
2120
+ )
2121
+
2122
+ internal static let getMempoolTx = GRPCMethodDescriptor(
2123
+ name: "GetMempoolTx",
2124
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetMempoolTx",
2125
+ type: GRPCCallType.serverStreaming
2126
+ )
2127
+
2128
+ internal static let getMempoolStream = GRPCMethodDescriptor(
2129
+ name: "GetMempoolStream",
2130
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetMempoolStream",
2131
+ type: GRPCCallType.serverStreaming
2132
+ )
2133
+
2134
+ internal static let getTreeState = GRPCMethodDescriptor(
2135
+ name: "GetTreeState",
2136
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTreeState",
2137
+ type: GRPCCallType.unary
2138
+ )
2139
+
2140
+ internal static let getLatestTreeState = GRPCMethodDescriptor(
2141
+ name: "GetLatestTreeState",
2142
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestTreeState",
2143
+ type: GRPCCallType.unary
2144
+ )
2145
+
2146
+ internal static let getSubtreeRoots = GRPCMethodDescriptor(
2147
+ name: "GetSubtreeRoots",
2148
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetSubtreeRoots",
2149
+ type: GRPCCallType.serverStreaming
2150
+ )
2151
+
2152
+ internal static let getAddressUtxos = GRPCMethodDescriptor(
2153
+ name: "GetAddressUtxos",
2154
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos",
2155
+ type: GRPCCallType.unary
2156
+ )
2157
+
2158
+ internal static let getAddressUtxosStream = GRPCMethodDescriptor(
2159
+ name: "GetAddressUtxosStream",
2160
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream",
2161
+ type: GRPCCallType.serverStreaming
2162
+ )
2163
+
2164
+ internal static let getLightdInfo = GRPCMethodDescriptor(
2165
+ name: "GetLightdInfo",
2166
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo",
2167
+ type: GRPCCallType.unary
2168
+ )
2169
+
2170
+ internal static let ping = GRPCMethodDescriptor(
2171
+ name: "Ping",
2172
+ path: "/cash.z.wallet.sdk.rpc.CompactTxStreamer/Ping",
2173
+ type: GRPCCallType.unary
2174
+ )
2175
+ }
2176
+ }