react-native-zcash 0.3.4 → 0.3.5
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.
- package/CHANGELOG.md +5 -0
- package/LICENSE +22 -0
- package/README.md +44 -44
- package/android/build.gradle +1 -1
- package/ios/RNZcash.m +0 -1
- package/ios/RNZcash.swift +14 -15
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/CompactBlockStorage.swift +123 -0
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/DatabaseMigrationManager.swift +222 -0
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/StorageError.swift +22 -0
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/StorageManager.swift +73 -0
- package/ios/ZCashLightClientKit/Block/Downloader/BlockDownloader.swift +240 -0
- package/ios/ZCashLightClientKit/Block/Downloader/CompactBlockDownloaderBuilder.swift +26 -0
- package/ios/ZCashLightClientKit/Block/Processor/CompactBlockDownloadOperation.swift +258 -0
- package/ios/ZCashLightClientKit/Block/Processor/CompactBlockEnhancementOperation.swift +157 -0
- package/ios/ZCashLightClientKit/Block/Processor/CompactBlockProcessor.swift +1454 -0
- package/ios/ZCashLightClientKit/Block/Processor/CompactBlockScanningOperation.swift +238 -0
- package/ios/ZCashLightClientKit/Block/Processor/CompactBlockValidationInformation.swift +66 -0
- package/ios/ZCashLightClientKit/Block/Processor/FetchUnspentTxOutputsOperation.swift +103 -0
- package/ios/ZCashLightClientKit/Block/Processor/FigureNextBatchOperation.swift +58 -0
- package/ios/ZCashLightClientKit/Block/Processor/ZcashOperation.swift +68 -0
- package/ios/ZCashLightClientKit/Constants/WalletBirthday+Constants.swift +58 -0
- package/ios/ZCashLightClientKit/Constants/WalletBirthday+mainnet.swift +20 -0
- package/ios/ZCashLightClientKit/Constants/WalletBirthday+testnet.swift +20 -0
- package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +245 -0
- package/ios/ZCashLightClientKit/DAO/BlockDao.swift +67 -0
- package/ios/ZCashLightClientKit/DAO/CompactBlockDAO.swift +24 -0
- package/ios/ZCashLightClientKit/DAO/NotesDao.swift +142 -0
- package/ios/ZCashLightClientKit/DAO/PagedTransactionDao.swift +62 -0
- package/ios/ZCashLightClientKit/DAO/PendingTransactionDao.swift +213 -0
- package/ios/ZCashLightClientKit/DAO/TransactionBuilder.swift +169 -0
- package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +393 -0
- package/ios/ZCashLightClientKit/DAO/UnspentTransactionOutputDao.swift +188 -0
- package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +201 -0
- package/ios/ZCashLightClientKit/Entity/CompactBlockEntity.swift +13 -0
- package/ios/ZCashLightClientKit/Entity/EncodedTransactionEntity.swift +26 -0
- package/ios/ZCashLightClientKit/Entity/PendingTransactionEntity.swift +205 -0
- package/ios/ZCashLightClientKit/Entity/ReceivedNoteEntity.swift +22 -0
- package/ios/ZCashLightClientKit/Entity/SentNoteEntity.swift +45 -0
- package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +161 -0
- package/ios/ZCashLightClientKit/Entity/UnspentTransactionOutputEntity.swift +17 -0
- package/ios/ZCashLightClientKit/Extensions/Data+Zcash.swift +17 -0
- package/ios/ZCashLightClientKit/Extensions/Data+internal.swift +35 -0
- package/ios/ZCashLightClientKit/Extensions/HexEncode.swift +41 -0
- package/ios/ZCashLightClientKit/Extensions/ZcashRust+Utils.swift +26 -0
- package/ios/ZCashLightClientKit/Extensions/ZcashSDK+extensions.swift +34 -0
- package/ios/ZCashLightClientKit/Initializer.swift +357 -0
- package/ios/ZCashLightClientKit/Model/WalletTypes.swift +108 -0
- package/ios/ZCashLightClientKit/Providers/ResourceProvider.swift +47 -0
- package/ios/ZCashLightClientKit/Repository/BlockRepository.swift +13 -0
- package/ios/ZCashLightClientKit/Repository/CompactBlockRepository.swift +75 -0
- package/ios/ZCashLightClientKit/Repository/NotesRepository.swift +16 -0
- package/ios/ZCashLightClientKit/Repository/PaginatedTransactionRepository.swift +35 -0
- package/ios/ZCashLightClientKit/Repository/PendingTransactionRepository.swift +19 -0
- package/ios/ZCashLightClientKit/Repository/TransactionRepository.swift +30 -0
- package/ios/ZCashLightClientKit/Repository/TransactionRepositoryBuilder.swift +24 -0
- package/ios/ZCashLightClientKit/Repository/UnspentTransactionOutputRepository.swift +18 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1000000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1010000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1020000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1030000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1040000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1050000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1060000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1070000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1080000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1090000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1100000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1110000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1120000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1130000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1140000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1150000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1160000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1170000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1180000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1190000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1200000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1210000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1220000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1230000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1240000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1250000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1260000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1270000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1280000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1290000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1300000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1310000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1320000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1330000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1340000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1350000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1360000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1370000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1380000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1390000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1400000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1410000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1420000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1430000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1440000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1450000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1460000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1470000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1480000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1490000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1850000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1860000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1870000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1880000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1890000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1900000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1910000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1920000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1930000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1940000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1950000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1960000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1970000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1980000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/1990000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2000000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2010000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2020000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2030000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2040000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2050000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2060000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2070000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2080000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2090000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2100000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2110000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2120000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2130000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2140000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2150000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2160000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/2170000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/419200.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/663150.json +8 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/850000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/860000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/870000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/880000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/890000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/900000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/910000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/920000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/930000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/940000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/950000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/960000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/970000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/980000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/mainnet/990000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1000000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1010000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1020000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1030000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1040000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1050000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1060000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1070000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1080000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1090000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1100000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1110000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1120000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1130000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1140000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1150000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1160000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1170000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1180000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1190000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1200000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1210000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1220000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1230000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1240000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1250000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1260000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1270000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1280000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1290000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1300000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1310000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1320000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1330000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1340000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1350000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1360000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1370000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1380000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1390000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1400000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1410000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1420000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1430000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1440000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1450000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1460000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1470000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1480000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1490000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1850000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/1860000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/280000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/290000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/300000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/310000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/320000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/330000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/340000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/350000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/360000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/370000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/380000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/390000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/400000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/410000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/420000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/430000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/440000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/450000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/460000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/470000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/480000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/490000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/850000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/860000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/870000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/880000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/890000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/900000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/910000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/920000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/930000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/940000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/950000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/960000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/970000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/980000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/saplingtree-checkpoints/testnet/990000.json +7 -0
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +718 -0
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +389 -0
- package/ios/ZCashLightClientKit/Rust/zcashlc.h +385 -0
- package/ios/ZCashLightClientKit/Service/LightWalletGRPCService.swift +551 -0
- package/ios/ZCashLightClientKit/Service/LightWalletService.swift +214 -0
- package/ios/ZCashLightClientKit/Service/Model/ZcashCompactBlock.swift +46 -0
- package/ios/ZCashLightClientKit/Service/ProtoBuf/Extensions/Protocolbuffer+Extensions.swift +50 -0
- package/ios/ZCashLightClientKit/Service/ProtoBuf/compact_formats.pb.swift +332 -0
- package/ios/ZCashLightClientKit/Service/ProtoBuf/proto/compact_formats.proto +56 -0
- package/ios/ZCashLightClientKit/Service/ProtoBuf/proto/service.proto +180 -0
- package/ios/ZCashLightClientKit/Service/ProtoBuf/service.grpc.swift +383 -0
- package/ios/ZCashLightClientKit/Service/ProtoBuf/service.pb.swift +1173 -0
- package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +929 -0
- package/ios/ZCashLightClientKit/Synchronizer.swift +430 -0
- package/ios/ZCashLightClientKit/Tool/DerivationTool.swift +344 -0
- package/ios/ZCashLightClientKit/Transaction/PersistentTransactionManager.swift +339 -0
- package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +116 -0
- package/ios/ZCashLightClientKit/Transaction/TransactionManager.swift +42 -0
- package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +216 -0
- package/ios/ZCashLightClientKit/Utils/Bundle+module.swift +30 -0
- package/ios/ZCashLightClientKit/Utils/LoggingProxy.swift +47 -0
- package/ios/ZCashLightClientKit/Utils/SaplingParameterDownloader.swift +124 -0
- package/ios/libzcashlc.xcframework/Info.plist +40 -0
- package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
- package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
- package/ios/react-native-zcash-Bridging-Header.h +2 -0
- package/ios/react-native-zcash.xcodeproj/project.pbxproj +1 -0
- package/lib/scripts/copyCheckpoints.d.ts +5 -0
- package/lib/scripts/updateSources.d.ts +1 -0
- package/package.json +20 -37
- package/react-native-zcash.podspec +17 -7
- package/ios/RNZcash-Bridging-Header.h +0 -6
- package/ios/RNZcash.xcodeproj/project.pbxproj +0 -271
- package/ios/RNZcash.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RNZcash.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/lib/src/browser.d.ts +0 -0
- package/lib/src/index.d.ts +0 -0
- package/lib/test/test.test.d.ts +0 -0
- package/scripts/copyCheckpoints.js +0 -12
- package/src/browser.ts +0 -36
- package/src/index.flow.js +0 -168
- package/src/index.ts +0 -1
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ServiceHelper.swift
|
|
3
|
+
// gRPC-PoC
|
|
4
|
+
//
|
|
5
|
+
// Created by Francisco Gindre on 29/08/2019.
|
|
6
|
+
// Copyright © 2019 Electric Coin Company. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
import GRPC
|
|
11
|
+
import NIO
|
|
12
|
+
import NIOHPACK
|
|
13
|
+
|
|
14
|
+
public typealias Channel = GRPC.GRPCChannel
|
|
15
|
+
|
|
16
|
+
public protocol LightWalletdInfo {
|
|
17
|
+
var version: String { get }
|
|
18
|
+
|
|
19
|
+
var vendor: String { get }
|
|
20
|
+
|
|
21
|
+
/// true
|
|
22
|
+
var taddrSupport: Bool { get }
|
|
23
|
+
|
|
24
|
+
/// either "main" or "test"
|
|
25
|
+
var chainName: String { get }
|
|
26
|
+
|
|
27
|
+
/// depends on mainnet or testnet
|
|
28
|
+
var saplingActivationHeight: UInt64 { get }
|
|
29
|
+
|
|
30
|
+
/// protocol identifier, see consensus/upgrades.cpp
|
|
31
|
+
var consensusBranchID: String { get }
|
|
32
|
+
|
|
33
|
+
/// latest block on the best chain
|
|
34
|
+
var blockHeight: UInt64 { get }
|
|
35
|
+
|
|
36
|
+
var gitCommit: String { get }
|
|
37
|
+
|
|
38
|
+
var branch: String { get }
|
|
39
|
+
|
|
40
|
+
var buildDate: String { get }
|
|
41
|
+
|
|
42
|
+
var buildUser: String { get }
|
|
43
|
+
|
|
44
|
+
/// less than tip height if zcashd is syncing
|
|
45
|
+
var estimatedHeight: UInt64 { get }
|
|
46
|
+
|
|
47
|
+
/// example: "v4.1.1-877212414"
|
|
48
|
+
var zcashdBuild: String { get }
|
|
49
|
+
|
|
50
|
+
/// example: "/MagicBean:4.1.1/"
|
|
51
|
+
var zcashdSubversion: String { get }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
extension LightdInfo: LightWalletdInfo {}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
Swift GRPC implementation of Lightwalletd service
|
|
58
|
+
*/
|
|
59
|
+
public enum GRPCResult: Equatable {
|
|
60
|
+
case success
|
|
61
|
+
case error(_ error: LightWalletServiceError)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public protocol CancellableCall {
|
|
65
|
+
func cancel()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
extension ServerStreamingCall: CancellableCall {
|
|
69
|
+
public func cancel() {
|
|
70
|
+
self.cancel(promise: self.eventLoop.makePromise(of: Void.self))
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public struct BlockProgress: Equatable {
|
|
75
|
+
public var startHeight: BlockHeight
|
|
76
|
+
public var targetHeight: BlockHeight
|
|
77
|
+
public var progressHeight: BlockHeight
|
|
78
|
+
|
|
79
|
+
public var progress: Float {
|
|
80
|
+
let overall = self.targetHeight - self.startHeight
|
|
81
|
+
|
|
82
|
+
return overall > 0 ? Float((self.progressHeight - self.startHeight)) / Float(overall) : 0
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public extension BlockProgress {
|
|
87
|
+
static let nullProgress = BlockProgress(startHeight: 0, targetHeight: 0, progressHeight: 0)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public class LightWalletGRPCService {
|
|
91
|
+
let channel: Channel
|
|
92
|
+
let connectionManager: ConnectionStatusManager
|
|
93
|
+
let compactTxStreamer: CompactTxStreamerClient
|
|
94
|
+
let singleCallTimeout: TimeLimit
|
|
95
|
+
let streamingCallTimeout: TimeLimit
|
|
96
|
+
|
|
97
|
+
var queue: DispatchQueue
|
|
98
|
+
|
|
99
|
+
public convenience init(endpoint: LightWalletEndpoint) {
|
|
100
|
+
self.init(
|
|
101
|
+
host: endpoint.host,
|
|
102
|
+
port: endpoint.port,
|
|
103
|
+
secure: endpoint.secure,
|
|
104
|
+
singleCallTimeout: endpoint.singleCallTimeoutInMillis,
|
|
105
|
+
streamingCallTimeout: endpoint.streamingCallTimeoutInMillis
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public init(host: String, port: Int = 9067, secure: Bool = true, singleCallTimeout: Int64 = 10000, streamingCallTimeout: Int64 = 10000) {
|
|
110
|
+
self.connectionManager = ConnectionStatusManager()
|
|
111
|
+
self.queue = DispatchQueue.init(label: "LightWalletGRPCService")
|
|
112
|
+
self.streamingCallTimeout = TimeLimit.timeout(.milliseconds(streamingCallTimeout))
|
|
113
|
+
self.singleCallTimeout = TimeLimit.timeout(.milliseconds(singleCallTimeout))
|
|
114
|
+
|
|
115
|
+
let configuration = ClientConnection.Configuration(
|
|
116
|
+
target: .hostAndPort(host, port),
|
|
117
|
+
eventLoopGroup: MultiThreadedEventLoopGroup(numberOfThreads: 1),
|
|
118
|
+
connectivityStateDelegate: connectionManager,
|
|
119
|
+
connectivityStateDelegateQueue: queue,
|
|
120
|
+
tls: secure ? .init() : nil
|
|
121
|
+
)
|
|
122
|
+
let channel = ClientConnection(configuration: configuration)
|
|
123
|
+
|
|
124
|
+
self.channel = channel
|
|
125
|
+
|
|
126
|
+
compactTxStreamer = CompactTxStreamerClient(
|
|
127
|
+
channel: self.channel,
|
|
128
|
+
defaultCallOptions: Self.callOptions(
|
|
129
|
+
timeLimit: TimeLimit.timeout(.seconds(Int64(singleCallTimeout)))
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
deinit {
|
|
135
|
+
_ = channel.close()
|
|
136
|
+
_ = compactTxStreamer.channel.close()
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
func stop() {
|
|
140
|
+
_ = channel.close()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
func blockRange(startHeight: BlockHeight, endHeight: BlockHeight? = nil, result: @escaping (CompactBlock) -> Void) throws -> ServerStreamingCall<BlockRange, CompactBlock> {
|
|
144
|
+
compactTxStreamer.getBlockRange(BlockRange(startHeight: startHeight, endHeight: endHeight), handler: result)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
func latestBlock() throws -> BlockID {
|
|
148
|
+
try compactTxStreamer.getLatestBlock(ChainSpec()).response.wait()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
func getTx(hash: String) throws -> RawTransaction {
|
|
152
|
+
var filter = TxFilter()
|
|
153
|
+
filter.hash = Data(hash.utf8)
|
|
154
|
+
|
|
155
|
+
return try compactTxStreamer.getTransaction(filter).response.wait()
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
static func callOptions(timeLimit: TimeLimit) -> CallOptions {
|
|
159
|
+
CallOptions(
|
|
160
|
+
customMetadata: HPACKHeaders(),
|
|
161
|
+
timeLimit: timeLimit,
|
|
162
|
+
messageEncoding: .disabled,
|
|
163
|
+
requestIDProvider: .autogenerated,
|
|
164
|
+
requestIDHeader: nil,
|
|
165
|
+
cacheable: false
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
extension LightWalletGRPCService: LightWalletService {
|
|
171
|
+
@discardableResult
|
|
172
|
+
public func blockStream(
|
|
173
|
+
startHeight: BlockHeight,
|
|
174
|
+
endHeight: BlockHeight,
|
|
175
|
+
result: @escaping (Result<GRPCResult, LightWalletServiceError>) -> Void,
|
|
176
|
+
handler: @escaping (ZcashCompactBlock) -> Void,
|
|
177
|
+
progress: @escaping (BlockProgress) -> Void
|
|
178
|
+
) -> CancellableCall {
|
|
179
|
+
let future = compactTxStreamer.getBlockRange(
|
|
180
|
+
BlockRange(
|
|
181
|
+
startHeight: startHeight,
|
|
182
|
+
endHeight: endHeight
|
|
183
|
+
),
|
|
184
|
+
callOptions: Self.callOptions(timeLimit: self.streamingCallTimeout),
|
|
185
|
+
handler: { compactBlock in
|
|
186
|
+
handler(ZcashCompactBlock(compactBlock: compactBlock))
|
|
187
|
+
progress(
|
|
188
|
+
BlockProgress(
|
|
189
|
+
startHeight: startHeight,
|
|
190
|
+
targetHeight: endHeight,
|
|
191
|
+
progressHeight: BlockHeight(compactBlock.height)
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
future.status.whenComplete { completionResult in
|
|
198
|
+
switch completionResult {
|
|
199
|
+
case .success(let status):
|
|
200
|
+
switch status.code {
|
|
201
|
+
case .ok:
|
|
202
|
+
result(.success(GRPCResult.success))
|
|
203
|
+
default:
|
|
204
|
+
result(.failure(LightWalletServiceError.mapCode(status)))
|
|
205
|
+
}
|
|
206
|
+
case .failure(let error):
|
|
207
|
+
result(.failure(LightWalletServiceError.genericError(error: error)))
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return future
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
public func getInfo() throws -> LightWalletdInfo {
|
|
214
|
+
try compactTxStreamer.getLightdInfo(Empty()).response.wait()
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public func getInfo(result: @escaping (Result<LightWalletdInfo, LightWalletServiceError>) -> Void) {
|
|
218
|
+
compactTxStreamer.getLightdInfo(Empty()).response.whenComplete { completionResult in
|
|
219
|
+
switch completionResult {
|
|
220
|
+
case .success(let info):
|
|
221
|
+
result(.success(info))
|
|
222
|
+
case .failure(let error):
|
|
223
|
+
result(.failure(error.mapToServiceError()))
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public func closeConnection() {
|
|
229
|
+
_ = channel.close()
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
public func fetchTransaction(txId: Data) throws -> TransactionEntity {
|
|
233
|
+
var txFilter = TxFilter()
|
|
234
|
+
txFilter.hash = txId
|
|
235
|
+
|
|
236
|
+
do {
|
|
237
|
+
let rawTx = try compactTxStreamer.getTransaction(txFilter).response.wait()
|
|
238
|
+
|
|
239
|
+
return TransactionBuilder.createTransactionEntity(txId: txId, rawTransaction: rawTx)
|
|
240
|
+
} catch {
|
|
241
|
+
throw error.mapToServiceError()
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
public func fetchTransaction(txId: Data, result: @escaping (Result<TransactionEntity, LightWalletServiceError>) -> Void) {
|
|
246
|
+
var txFilter = TxFilter()
|
|
247
|
+
txFilter.hash = txId
|
|
248
|
+
|
|
249
|
+
compactTxStreamer.getTransaction(txFilter).response.whenComplete { response in
|
|
250
|
+
switch response {
|
|
251
|
+
case .failure(let error):
|
|
252
|
+
result(.failure(error.mapToServiceError()))
|
|
253
|
+
case .success(let rawTx):
|
|
254
|
+
result(.success(TransactionBuilder.createTransactionEntity(txId: txId, rawTransaction: rawTx)))
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
public func submit(spendTransaction: Data, result: @escaping (Result<LightWalletServiceResponse, LightWalletServiceError>) -> Void) {
|
|
260
|
+
do {
|
|
261
|
+
let transaction = try RawTransaction(serializedData: spendTransaction)
|
|
262
|
+
let response = self.compactTxStreamer.sendTransaction(transaction).response
|
|
263
|
+
|
|
264
|
+
response.whenComplete { responseResult in
|
|
265
|
+
switch responseResult {
|
|
266
|
+
case .failure(let error):
|
|
267
|
+
result(.failure(LightWalletServiceError.sentFailed(error: error)))
|
|
268
|
+
case .success(let success):
|
|
269
|
+
result(.success(success))
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
} catch {
|
|
273
|
+
result(.failure(error.mapToServiceError()))
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
public func submit(spendTransaction: Data) throws -> LightWalletServiceResponse {
|
|
278
|
+
let rawTx = RawTransaction.with { raw in
|
|
279
|
+
raw.data = spendTransaction
|
|
280
|
+
}
|
|
281
|
+
do {
|
|
282
|
+
return try compactTxStreamer.sendTransaction(rawTx).response.wait()
|
|
283
|
+
} catch {
|
|
284
|
+
throw error.mapToServiceError()
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
public func blockRange(_ range: CompactBlockRange) throws -> [ZcashCompactBlock] {
|
|
289
|
+
var blocks: [CompactBlock] = []
|
|
290
|
+
|
|
291
|
+
let response = compactTxStreamer.getBlockRange(
|
|
292
|
+
range.blockRange(),
|
|
293
|
+
handler: { blocks.append($0) }
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
let status = try response.status.wait()
|
|
297
|
+
|
|
298
|
+
switch status.code {
|
|
299
|
+
case .ok:
|
|
300
|
+
return blocks.asZcashCompactBlocks()
|
|
301
|
+
default:
|
|
302
|
+
throw LightWalletServiceError.mapCode(status)
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
public func latestBlockHeight(result: @escaping (Result<BlockHeight, LightWalletServiceError>) -> Void) {
|
|
307
|
+
let response = compactTxStreamer.getLatestBlock(ChainSpec()).response
|
|
308
|
+
|
|
309
|
+
response.whenSuccessBlocking(onto: queue) { blockID in
|
|
310
|
+
guard let blockHeight = Int(exactly: blockID.height) else {
|
|
311
|
+
result(.failure(LightWalletServiceError.generalError(message: "error creating blockheight from BlockID \(blockID)")))
|
|
312
|
+
return
|
|
313
|
+
}
|
|
314
|
+
result(.success(blockHeight))
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
response.whenFailureBlocking(onto: queue) { error in
|
|
318
|
+
result(.failure(error.mapToServiceError()))
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
public func blockRange(_ range: CompactBlockRange, result: @escaping (Result<[ZcashCompactBlock], LightWalletServiceError>) -> Void) {
|
|
323
|
+
queue.async { [weak self] in
|
|
324
|
+
guard let self = self else { return }
|
|
325
|
+
|
|
326
|
+
var blocks: [CompactBlock] = []
|
|
327
|
+
let response = self.compactTxStreamer.getBlockRange(range.blockRange(), handler: { blocks.append($0) })
|
|
328
|
+
|
|
329
|
+
do {
|
|
330
|
+
let status = try response.status.wait()
|
|
331
|
+
switch status.code {
|
|
332
|
+
case .ok:
|
|
333
|
+
result(.success(blocks.asZcashCompactBlocks()))
|
|
334
|
+
|
|
335
|
+
default:
|
|
336
|
+
result(.failure(.mapCode(status)))
|
|
337
|
+
}
|
|
338
|
+
} catch {
|
|
339
|
+
result(.failure(error.mapToServiceError()))
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
public func latestBlockHeight() throws -> BlockHeight {
|
|
345
|
+
guard let height = try? latestBlock().compactBlockHeight() else {
|
|
346
|
+
throw LightWalletServiceError.invalidBlock
|
|
347
|
+
}
|
|
348
|
+
return height
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
public func fetchUTXOs(for tAddress: String, height: BlockHeight) throws -> [UnspentTransactionOutputEntity] {
|
|
352
|
+
let arg = GetAddressUtxosArg.with { utxoArgs in
|
|
353
|
+
utxoArgs.addresses = [tAddress]
|
|
354
|
+
utxoArgs.startHeight = UInt64(height)
|
|
355
|
+
}
|
|
356
|
+
do {
|
|
357
|
+
return try self.compactTxStreamer.getAddressUtxos(arg).response.wait().addressUtxos.map { reply in
|
|
358
|
+
UTXO(
|
|
359
|
+
id: nil,
|
|
360
|
+
address: tAddress,
|
|
361
|
+
prevoutTxId: reply.txid,
|
|
362
|
+
prevoutIndex: Int(reply.index),
|
|
363
|
+
script: reply.script,
|
|
364
|
+
valueZat: Int(reply.valueZat),
|
|
365
|
+
height: Int(reply.height),
|
|
366
|
+
spentInTx: nil
|
|
367
|
+
)
|
|
368
|
+
}
|
|
369
|
+
} catch {
|
|
370
|
+
throw error.mapToServiceError()
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
public func fetchUTXOs(for tAddress: String, height: BlockHeight, result: @escaping (Result<[UnspentTransactionOutputEntity], LightWalletServiceError>) -> Void) {
|
|
375
|
+
queue.async { [weak self] in
|
|
376
|
+
guard let self = self else { return }
|
|
377
|
+
let arg = GetAddressUtxosArg.with { utxoArgs in
|
|
378
|
+
utxoArgs.addresses = [tAddress]
|
|
379
|
+
utxoArgs.startHeight = UInt64(height)
|
|
380
|
+
}
|
|
381
|
+
var utxos: [UnspentTransactionOutputEntity] = []
|
|
382
|
+
let response = self.compactTxStreamer.getAddressUtxosStream(arg) { reply in
|
|
383
|
+
utxos.append(
|
|
384
|
+
UTXO(
|
|
385
|
+
id: nil,
|
|
386
|
+
address: tAddress,
|
|
387
|
+
prevoutTxId: reply.txid,
|
|
388
|
+
prevoutIndex: Int(reply.index),
|
|
389
|
+
script: reply.script,
|
|
390
|
+
valueZat: Int(reply.valueZat),
|
|
391
|
+
height: Int(reply.height),
|
|
392
|
+
spentInTx: nil
|
|
393
|
+
)
|
|
394
|
+
)
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
do {
|
|
398
|
+
let status = try response.status.wait()
|
|
399
|
+
switch status.code {
|
|
400
|
+
case .ok:
|
|
401
|
+
result(.success(utxos))
|
|
402
|
+
default:
|
|
403
|
+
result(.failure(.mapCode(status)))
|
|
404
|
+
}
|
|
405
|
+
} catch {
|
|
406
|
+
result(.failure(error.mapToServiceError()))
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
public func fetchUTXOs(for tAddresses: [String], height: BlockHeight) throws -> [UnspentTransactionOutputEntity] {
|
|
412
|
+
guard !tAddresses.isEmpty else {
|
|
413
|
+
return [] // FIXME: throw a real error
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
var utxos: [UnspentTransactionOutputEntity] = []
|
|
417
|
+
|
|
418
|
+
let arg = GetAddressUtxosArg.with { utxoArgs in
|
|
419
|
+
utxoArgs.addresses = tAddresses
|
|
420
|
+
utxoArgs.startHeight = UInt64(height)
|
|
421
|
+
}
|
|
422
|
+
utxos.append(
|
|
423
|
+
contentsOf:
|
|
424
|
+
try self.compactTxStreamer.getAddressUtxos(arg).response.wait().addressUtxos.map { reply in
|
|
425
|
+
UTXO(
|
|
426
|
+
id: nil,
|
|
427
|
+
address: reply.address,
|
|
428
|
+
prevoutTxId: reply.txid,
|
|
429
|
+
prevoutIndex: Int(reply.index),
|
|
430
|
+
script: reply.script,
|
|
431
|
+
valueZat: Int(reply.valueZat),
|
|
432
|
+
height: Int(reply.height),
|
|
433
|
+
spentInTx: nil
|
|
434
|
+
)
|
|
435
|
+
}
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
return utxos
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
public func fetchUTXOs(
|
|
442
|
+
for tAddresses: [String],
|
|
443
|
+
height: BlockHeight,
|
|
444
|
+
result: @escaping (Result<[UnspentTransactionOutputEntity], LightWalletServiceError>) -> Void
|
|
445
|
+
) {
|
|
446
|
+
guard !tAddresses.isEmpty else {
|
|
447
|
+
return result(.success([])) // FIXME: throw a real error
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
var utxos: [UnspentTransactionOutputEntity] = []
|
|
451
|
+
self.queue.async { [weak self] in
|
|
452
|
+
guard let self = self else { return }
|
|
453
|
+
let args = GetAddressUtxosArg.with { utxoArgs in
|
|
454
|
+
utxoArgs.addresses = tAddresses
|
|
455
|
+
utxoArgs.startHeight = UInt64(height)
|
|
456
|
+
}
|
|
457
|
+
do {
|
|
458
|
+
let response = try self.compactTxStreamer.getAddressUtxosStream(args) { reply in
|
|
459
|
+
utxos.append(
|
|
460
|
+
UTXO(
|
|
461
|
+
id: nil,
|
|
462
|
+
address: reply.address,
|
|
463
|
+
prevoutTxId: reply.txid,
|
|
464
|
+
prevoutIndex: Int(reply.index),
|
|
465
|
+
script: reply.script,
|
|
466
|
+
valueZat: Int(reply.valueZat),
|
|
467
|
+
height: Int(reply.height),
|
|
468
|
+
spentInTx: nil
|
|
469
|
+
)
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
.status
|
|
473
|
+
.wait()
|
|
474
|
+
|
|
475
|
+
switch response.code {
|
|
476
|
+
case .ok:
|
|
477
|
+
result(.success(utxos))
|
|
478
|
+
default:
|
|
479
|
+
result(.failure(.mapCode(response)))
|
|
480
|
+
}
|
|
481
|
+
} catch {
|
|
482
|
+
result(.failure(error.mapToServiceError()))
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
// MARK: - Extensions
|
|
489
|
+
|
|
490
|
+
extension Notification.Name {
|
|
491
|
+
static let connectionStatusChanged = Notification.Name("LightWalletServiceConnectivityStatusChanged")
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
extension TimeAmount {
|
|
495
|
+
static let singleCallTimeout = TimeAmount.seconds(30)
|
|
496
|
+
static let streamingCallTimeout = TimeAmount.minutes(10)
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
extension CallOptions {
|
|
500
|
+
static var lwdCall: CallOptions {
|
|
501
|
+
CallOptions(
|
|
502
|
+
customMetadata: HPACKHeaders(),
|
|
503
|
+
timeLimit: .timeout(.singleCallTimeout),
|
|
504
|
+
messageEncoding: .disabled,
|
|
505
|
+
requestIDProvider: .autogenerated,
|
|
506
|
+
requestIDHeader: nil,
|
|
507
|
+
cacheable: false
|
|
508
|
+
)
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
extension Error {
|
|
513
|
+
func mapToServiceError() -> LightWalletServiceError {
|
|
514
|
+
guard let grpcError = self as? GRPCStatusTransformable else {
|
|
515
|
+
return LightWalletServiceError.genericError(error: self)
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return LightWalletServiceError.mapCode(grpcError.makeGRPCStatus())
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
extension LightWalletServiceError {
|
|
523
|
+
static func mapCode(_ status: GRPCStatus) -> LightWalletServiceError {
|
|
524
|
+
switch status.code {
|
|
525
|
+
case .ok:
|
|
526
|
+
return LightWalletServiceError.unknown
|
|
527
|
+
case .cancelled:
|
|
528
|
+
return LightWalletServiceError.userCancelled
|
|
529
|
+
case .unknown:
|
|
530
|
+
return LightWalletServiceError.generalError(message: status.message ?? "GRPC unknown error contains no message")
|
|
531
|
+
case .deadlineExceeded:
|
|
532
|
+
return LightWalletServiceError.timeOut
|
|
533
|
+
default:
|
|
534
|
+
return LightWalletServiceError.genericError(error: status)
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
class ConnectionStatusManager: ConnectivityStateDelegate {
|
|
540
|
+
func connectivityStateDidChange(from oldState: ConnectivityState, to newState: ConnectivityState) {
|
|
541
|
+
LoggerProxy.event("Connection Changed from \(oldState) to \(newState)")
|
|
542
|
+
NotificationCenter.default.post(
|
|
543
|
+
name: .blockProcessorConnectivityStateChanged,
|
|
544
|
+
object: self,
|
|
545
|
+
userInfo: [
|
|
546
|
+
CompactBlockProcessorNotificationKey.currentConnectivityStatus: newState,
|
|
547
|
+
CompactBlockProcessorNotificationKey.previousConnectivityStatus: oldState
|
|
548
|
+
]
|
|
549
|
+
)
|
|
550
|
+
}
|
|
551
|
+
}
|