react-native-zcash 0.3.4 → 0.4.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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +22 -0
- package/README.md +40 -37
- package/android/build.gradle +7 -5
- package/android/src/main/assets/saplingtree/mainnet/1310000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1320000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1330000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1340000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1350000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1360000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1370000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1380000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1390000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1400000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1410000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1420000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1430000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1440000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1450000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1460000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1470000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1480000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1490000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1500000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1510000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1520000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1530000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1540000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1550000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1560000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1570000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1580000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1590000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1600000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1610000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1620000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1630000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1640000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1650000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1660000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1670000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1680000.json +1 -1
- package/android/src/main/assets/saplingtree/mainnet/1690000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1700000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1710000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1720000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1730000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1740000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1750000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1760000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1770000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1780000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1790000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1800000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1810000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1820000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1830000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1840000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1850000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1860000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1870000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1880000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1890000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1900000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1910000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1920000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1930000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1940000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1950000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1960000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1970000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1980000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/1990000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2000000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2010000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2020000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2030000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2040000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2050000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2060000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2070000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2080000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2090000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2100000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2110000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2120000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2130000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2140000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2150000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2160000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2170000.json +2 -1
- package/android/src/main/assets/saplingtree/mainnet/2180000.json +8 -0
- package/android/src/main/assets/saplingtree/mainnet/2190000.json +8 -0
- package/android/src/main/assets/saplingtree/mainnet/2200000.json +8 -0
- package/android/src/main/assets/saplingtree/mainnet/2210000.json +8 -0
- package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +179 -175
- package/android/src/main/java/app/edge/rnzcash/RNZcashPackage.kt +2 -3
- package/ios/RNZcash.m +5 -22
- package/ios/RNZcash.swift +532 -514
- package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +1365 -0
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/ConnectorProvider.swift +12 -0
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/DatabaseStorageError.swift +20 -0
- package/ios/ZCashLightClientKit/Block/DatabaseStorage/SimpleConnectionProvider.swift +39 -0
- package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +295 -0
- package/ios/ZCashLightClientKit/Block/Download/BlockDownloaderService.swift +117 -0
- package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +123 -0
- package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +114 -0
- package/ios/ZCashLightClientKit/Block/FilesystemStorage/FSCompactBlockRepository.swift +419 -0
- package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +52 -0
- package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +114 -0
- package/ios/ZCashLightClientKit/Block/Utils/AfterSyncHooksManager.swift +88 -0
- package/ios/ZCashLightClientKit/Block/Utils/InternalSyncProgress.swift +200 -0
- package/ios/ZCashLightClientKit/Block/Validate/BlockValidator.swift +51 -0
- package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +84 -0
- package/ios/ZCashLightClientKit/CombineSynchronizer.swift +76 -0
- package/ios/ZCashLightClientKit/Constants/Checkpoint+Constants.swift +98 -0
- package/ios/ZCashLightClientKit/Constants/Checkpoint+mainnet.swift +19 -0
- package/ios/ZCashLightClientKit/Constants/Checkpoint+testnet.swift +20 -0
- package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +215 -0
- package/ios/ZCashLightClientKit/DAO/BlockDao.swift +112 -0
- package/ios/ZCashLightClientKit/DAO/PagedTransactionDao.swift +54 -0
- package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +245 -0
- package/ios/ZCashLightClientKit/DAO/UnspentTransactionOutputDao.swift +210 -0
- package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +199 -0
- package/ios/ZCashLightClientKit/Entity/BlockProgress.swift +24 -0
- package/ios/ZCashLightClientKit/Entity/EncodedTransactionEntity.swift +26 -0
- package/ios/ZCashLightClientKit/Entity/SentNoteEntity.swift +48 -0
- package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +235 -0
- package/ios/ZCashLightClientKit/Entity/UnspentTransactionOutputEntity.swift +18 -0
- package/ios/ZCashLightClientKit/Entity/ZcashCompactBlock.swift +96 -0
- package/ios/ZCashLightClientKit/Error/Sourcery/ZcashError.stencil +40 -0
- package/ios/ZCashLightClientKit/Error/Sourcery/ZcashErrorCode.stencil +15 -0
- package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +34 -0
- package/ios/ZCashLightClientKit/Error/ZcashError.swift +820 -0
- package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +306 -0
- package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +596 -0
- package/ios/ZCashLightClientKit/Extensions/Data+Zcash.swift +17 -0
- package/ios/ZCashLightClientKit/Extensions/Data+internal.swift +35 -0
- package/ios/ZCashLightClientKit/Extensions/Error+ZcashError.swift +18 -0
- package/ios/ZCashLightClientKit/Extensions/HexEncode.swift +41 -0
- package/ios/ZCashLightClientKit/Extensions/NumberFormatter+Zcash.swift +19 -0
- package/ios/ZCashLightClientKit/Extensions/URL+UpdateWithAlias.swift +36 -0
- package/ios/ZCashLightClientKit/Extensions/Undescribable.swift +22 -0
- package/ios/ZCashLightClientKit/Extensions/Zatoshi+SQLite.swift +20 -0
- package/ios/ZCashLightClientKit/Extensions/ZcashRust+Utils.swift +26 -0
- package/ios/ZCashLightClientKit/Extensions/ZcashSDK+extensions.swift +34 -0
- package/ios/ZCashLightClientKit/Initializer.swift +433 -0
- package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +270 -0
- package/ios/ZCashLightClientKit/Model/Checkpoint.swift +84 -0
- package/ios/ZCashLightClientKit/Model/Memo.swift +236 -0
- package/ios/ZCashLightClientKit/Model/WalletTypes.swift +281 -0
- package/ios/ZCashLightClientKit/Model/Zatoshi.swift +115 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +342 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/Extensions/Protocolbuffer+Extensions.swift +50 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/compact_formats.pb.swift +399 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proto/compact_formats.proto +66 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proto/service.proto +185 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/service.grpc.swift +1123 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/service.pb.swift +1208 -0
- package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +195 -0
- package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +69 -0
- package/ios/ZCashLightClientKit/Providers/ResourceProvider.swift +65 -0
- package/ios/ZCashLightClientKit/Repository/BlockRepository.swift +13 -0
- package/ios/ZCashLightClientKit/Repository/CompactBlockRepository.swift +43 -0
- package/ios/ZCashLightClientKit/Repository/NotesRepository.swift +17 -0
- package/ios/ZCashLightClientKit/Repository/PaginatedTransactionRepository.swift +35 -0
- package/ios/ZCashLightClientKit/Repository/TransactionRepository.swift +29 -0
- package/ios/ZCashLightClientKit/Repository/TransactionRepositoryBuilder.swift +24 -0
- package/ios/ZCashLightClientKit/Repository/UnspentTransactionOutputRepository.swift +16 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1000000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1010000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1020000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1030000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1040000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1050000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1060000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1070000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1080000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1090000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1100000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1110000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1120000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1130000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1140000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1150000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1160000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1170000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1180000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1190000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1200000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1210000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1220000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1230000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1240000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1250000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1260000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1270000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1280000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1290000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1300000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1310000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1320000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1330000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1340000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1350000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1360000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1370000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1380000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1390000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1400000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1410000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1420000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1430000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1440000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1450000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1460000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1470000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1480000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1490000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1631000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1686871.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1687104.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1690000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1700000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1710000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1720000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1722500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1725000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1727500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1730000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1732500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1735000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1737500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1740000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1742500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1745000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1747500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1750000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1752500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1755000.json +9 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1757500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1760000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1762500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1765000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1767500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1770000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1772500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1775000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1777500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1780000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1782500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1785000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1787500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1790000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1792500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1795000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1797500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1800000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1802500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1805000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1807500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1810000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1812500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1815000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1817500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1820000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1822500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1825000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1827500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1830000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1832500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1835000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1837500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1840000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1842500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1845000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1847500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1850000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1852500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1855000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1857500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1860000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1862500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1865000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1867500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1870000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1872500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1875000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1877500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1880000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1882500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1885000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1887500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1890000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1892500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1895000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1897500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1900000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1902500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1905000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1907500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1910000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1912500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1915000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1917500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1920000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1922500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1925000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1927500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1930000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1932500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1935000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1937500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1940000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1942500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1945000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1947500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1950000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1952500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1955000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1957500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1960000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1962500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1965000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1967500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1970000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1972500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1975000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1977500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1980000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1982500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1985000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1987500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1990000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1992500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1995000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/1997500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2000000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2002500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2005000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2007500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2010000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2012500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2015000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2017500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2020000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2022500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2025000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2027500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2030000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2032500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2035000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2037500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2040000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2042500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2045000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2047500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2050000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2052500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2055000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2057500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2060000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2062500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2065000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2067500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2070000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2072500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2075000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2077500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2080000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2082500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2085000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2087500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2090000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2100000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2110000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2120000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2130000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2140000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2150000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2160000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2170000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2180000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2190000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2200000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2210000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/419200.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/663150.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/850000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/860000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/870000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/880000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/890000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/900000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/910000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/920000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/930000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/940000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/950000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/960000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/970000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/980000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/990000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1000000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1010000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1020000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1030000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1040000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1050000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1060000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1070000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1080000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1090000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1100000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1110000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1120000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1130000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1140000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1150000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1160000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1170000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1180000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1190000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1200000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1210000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1220000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1230000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1240000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1250000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1260000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1270000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1280000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1290000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1300000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1310000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1320000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1330000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1340000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1350000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1360000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1370000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1380000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1390000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1400000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1410000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1420000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1430000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1440000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1450000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1460000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1470000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1480000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1490000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1842420.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1850000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1860000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1870000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1880000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1890000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1900000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1910000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1920000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1930000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1940000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1950000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1960000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1970000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1980000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/1990000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2000000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2010000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2020000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2030000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2040000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2050000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2060000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2070000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2080000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2090000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2100000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2110000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2120000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2130000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2140000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2150000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2160000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2170000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2180000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2190000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2200000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2210000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2220000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2230000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2240000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2250000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2260000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2270000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2280000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2290000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2300000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2310000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2320000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2330000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2340000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/280000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/290000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/300000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/310000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/320000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/330000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/340000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/350000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/360000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/370000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/380000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/390000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/400000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/410000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/420000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/430000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/440000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/450000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/460000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/470000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/480000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/490000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/500000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/510000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/520000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/530000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/540000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/550000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/560000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/570000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/580000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/590000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/600000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/610000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/620000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/630000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/640000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/650000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/660000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/670000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/680000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/690000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/700000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/710000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/720000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/730000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/740000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/750000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/760000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/770000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/780000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/790000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/800000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/810000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/820000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/830000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/840000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/850000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/860000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/870000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/880000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/890000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/900000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/910000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/920000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/930000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/940000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/950000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/960000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/970000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/980000.json +7 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/990000.json +7 -0
- package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +218 -0
- package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackendWelding.swift +88 -0
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +645 -0
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +256 -0
- package/ios/ZCashLightClientKit/Rust/zcashlc.h +1051 -0
- package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +180 -0
- package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +175 -0
- package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +207 -0
- package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +663 -0
- package/ios/ZCashLightClientKit/Synchronizer.swift +504 -0
- package/ios/ZCashLightClientKit/Tool/DerivationTool.swift +207 -0
- package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +66 -0
- package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +165 -0
- package/ios/ZCashLightClientKit/Utils/AsyncToClosureGateway.swift +46 -0
- package/ios/ZCashLightClientKit/Utils/AsyncToCombineGateway.swift +59 -0
- package/ios/ZCashLightClientKit/Utils/Clamped.swift +32 -0
- package/ios/ZCashLightClientKit/Utils/DIContainer.swift +86 -0
- package/ios/ZCashLightClientKit/Utils/GenericActor.swift +18 -0
- package/ios/ZCashLightClientKit/Utils/LoggingProxy.swift +48 -0
- package/ios/ZCashLightClientKit/Utils/OSLogger.swift +109 -0
- package/ios/ZCashLightClientKit/Utils/SaplingParameterDownloader.swift +159 -0
- package/ios/ZCashLightClientKit/Utils/SpecificCombineTypes.swift +16 -0
- package/ios/ZCashLightClientKit/Utils/SyncSessionIDGenerator.swift +32 -0
- package/ios/ZCashLightClientKit/Utils/Task+sleep.swift +14 -0
- package/ios/ZCashLightClientKit/Utils/UsedAliasesChecker.swift +41 -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/rnzcash.rn.js +37 -80
- package/lib/rnzcash.rn.js.map +1 -1
- package/lib/scripts/copyCheckpoints.d.ts +5 -0
- package/lib/scripts/updateSources.d.ts +1 -0
- package/lib/src/react-native.d.ts +5 -10
- package/lib/src/types.d.ts +3 -4
- package/package.json +23 -37
- package/react-native-zcash.podspec +19 -8
- package/src/react-native.ts +15 -41
- package/src/types.ts +3 -4
- 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,207 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DerivationTool.swift
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Francisco Gindre on 10/8/20.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Combine
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
public protocol KeyValidation {
|
|
12
|
+
func isValidUnifiedFullViewingKey(_ ufvk: String) -> Bool
|
|
13
|
+
func isValidTransparentAddress(_ tAddress: String) -> Bool
|
|
14
|
+
func isValidSaplingAddress(_ zAddress: String) -> Bool
|
|
15
|
+
func isValidSaplingExtendedSpendingKey(_ extsk: String) -> Bool
|
|
16
|
+
func isValidUnifiedAddress(_ unifiedAddress: String) -> Bool
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public protocol KeyDeriving {
|
|
20
|
+
/// Given the seed bytes tand the account index, return the UnifiedSpendingKey
|
|
21
|
+
/// - Parameter seed: `[Uint8]` seed bytes
|
|
22
|
+
/// - Parameter accountNumber: `Int` with the account number
|
|
23
|
+
/// - Throws:
|
|
24
|
+
/// - `derivationToolSpendingKeyInvalidAccount` if the `accountIndex` is invalid.
|
|
25
|
+
/// - some `ZcashError.rust*` error if the derivation fails.
|
|
26
|
+
/// - Returns a `UnifiedSpendingKey`
|
|
27
|
+
func deriveUnifiedSpendingKey(seed: [UInt8], accountIndex: Int) throws -> UnifiedSpendingKey
|
|
28
|
+
|
|
29
|
+
/// Given a spending key, return the associated viewing key.
|
|
30
|
+
/// - Parameter spendingKey: the `UnifiedSpendingKey` from which to derive the `UnifiedFullViewingKey` from.
|
|
31
|
+
/// - Throws: some `ZcashError.rust*` error if the derivation fails.
|
|
32
|
+
/// - Returns: the viewing key that corresponds to the spending key.
|
|
33
|
+
func deriveUnifiedFullViewingKey(from spendingKey: UnifiedSpendingKey) throws -> UnifiedFullViewingKey
|
|
34
|
+
|
|
35
|
+
/// Extracts the `SaplingAddress` from the given `UnifiedAddress`
|
|
36
|
+
/// - Parameter address: the `UnifiedAddress`
|
|
37
|
+
/// - Throws: some `ZcashError.rust*` error if the derivation fails.
|
|
38
|
+
func saplingReceiver(from unifiedAddress: UnifiedAddress) throws -> SaplingAddress
|
|
39
|
+
|
|
40
|
+
/// Extracts the `TransparentAddress` from the given `UnifiedAddress`
|
|
41
|
+
/// - Parameter address: the `UnifiedAddress`
|
|
42
|
+
/// - Throws: some `ZcashError.rust*` error if the derivation fails.
|
|
43
|
+
func transparentReceiver(from unifiedAddress: UnifiedAddress) throws -> TransparentAddress
|
|
44
|
+
|
|
45
|
+
/// Extracts the `UnifiedAddress.ReceiverTypecodes` from the given `UnifiedAddress`
|
|
46
|
+
/// - Throws: some `ZcashError.rust*` error if the derivation fails.
|
|
47
|
+
/// - Parameter address: the `UnifiedAddress`
|
|
48
|
+
func receiverTypecodesFromUnifiedAddress(_ address: UnifiedAddress) throws -> [UnifiedAddress.ReceiverTypecodes]
|
|
49
|
+
|
|
50
|
+
static func getAddressMetadata(_ addr: String) -> AddressMetadata?
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public class DerivationTool: KeyDeriving {
|
|
54
|
+
let backend: ZcashKeyDerivationBackendWelding
|
|
55
|
+
|
|
56
|
+
public init(networkType: NetworkType) {
|
|
57
|
+
self.backend = ZcashKeyDerivationBackend(networkType: networkType)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public func saplingReceiver(from unifiedAddress: UnifiedAddress) throws -> SaplingAddress {
|
|
61
|
+
try backend.getSaplingReceiver(for: unifiedAddress)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public func transparentReceiver(from unifiedAddress: UnifiedAddress) throws -> TransparentAddress {
|
|
65
|
+
try backend.getTransparentReceiver(for: unifiedAddress)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public static func getAddressMetadata(_ addr: String) -> AddressMetadata? {
|
|
69
|
+
ZcashKeyDerivationBackend.getAddressMetadata(addr)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// Given a spending key, return the associated viewing key.
|
|
73
|
+
/// - Parameter spendingKey: the `UnifiedSpendingKey` from which to derive the `UnifiedFullViewingKey` from.
|
|
74
|
+
/// - Returns: the viewing key that corresponds to the spending key.
|
|
75
|
+
public func deriveUnifiedFullViewingKey(from spendingKey: UnifiedSpendingKey) throws -> UnifiedFullViewingKey {
|
|
76
|
+
try backend.deriveUnifiedFullViewingKey(from: spendingKey)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// Given a seed and a number of accounts, return the associated spending keys.
|
|
80
|
+
/// - Parameter seed: the seed from which to derive spending keys.
|
|
81
|
+
/// - Parameter numberOfAccounts: the number of accounts to use. Multiple accounts are not fully
|
|
82
|
+
/// supported so the default value of 1 is recommended.
|
|
83
|
+
/// - Returns: the spending keys that correspond to the seed, formatted as Strings.
|
|
84
|
+
public func deriveUnifiedSpendingKey(seed: [UInt8], accountIndex: Int) throws -> UnifiedSpendingKey {
|
|
85
|
+
guard accountIndex >= 0, let accountIndex = Int32(exactly: accountIndex) else { throw ZcashError.derivationToolSpendingKeyInvalidAccount }
|
|
86
|
+
return try backend.deriveUnifiedSpendingKey(from: seed, accountIndex: accountIndex)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public func receiverTypecodesFromUnifiedAddress(_ address: UnifiedAddress) throws -> [UnifiedAddress.ReceiverTypecodes] {
|
|
90
|
+
return try backend.receiverTypecodesOnUnifiedAddress(address.stringEncoded)
|
|
91
|
+
.map { UnifiedAddress.ReceiverTypecodes(typecode: $0) }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public struct AddressMetadata {
|
|
96
|
+
let networkType: NetworkType
|
|
97
|
+
let addressType: AddressType
|
|
98
|
+
|
|
99
|
+
public init(network: NetworkType, addrType: AddressType) {
|
|
100
|
+
self.networkType = network
|
|
101
|
+
self.addressType = addrType
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
extension DerivationTool: KeyValidation {
|
|
106
|
+
public func isValidUnifiedFullViewingKey(_ ufvk: String) -> Bool {
|
|
107
|
+
backend.isValidUnifiedFullViewingKey(ufvk)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public func isValidUnifiedAddress(_ unifiedAddress: String) -> Bool {
|
|
111
|
+
backend.isValidUnifiedAddress(unifiedAddress)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public func isValidTransparentAddress(_ tAddress: String) -> Bool {
|
|
115
|
+
backend.isValidTransparentAddress(tAddress)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public func isValidSaplingAddress(_ zAddress: String) -> Bool {
|
|
119
|
+
backend.isValidSaplingAddress(zAddress)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public func isValidSaplingExtendedSpendingKey(_ extsk: String) -> Bool {
|
|
123
|
+
backend.isValidSaplingExtendedSpendingKey(extsk)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
extension TransparentAddress {
|
|
128
|
+
/// This constructor is for internal use for Strings encodings that are assumed to be
|
|
129
|
+
/// already validated by another function. only for internal use. Unless you are
|
|
130
|
+
/// constructing an address from a primitive function of the FFI, you probably
|
|
131
|
+
/// shouldn't be using this.
|
|
132
|
+
init(validatedEncoding: String) {
|
|
133
|
+
self.encoding = validatedEncoding
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
extension SaplingAddress {
|
|
138
|
+
/// This constructor is for internal use for Strings encodings that are assumed to be
|
|
139
|
+
/// already validated by another function. only for internal use. Unless you are
|
|
140
|
+
/// constructing an address from a primitive function of the FFI, you probably
|
|
141
|
+
/// shouldn't be using this.
|
|
142
|
+
init(validatedEncoding: String) {
|
|
143
|
+
self.encoding = validatedEncoding
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
extension UnifiedAddress {
|
|
148
|
+
/// This constructor is for internal use for Strings encodings that are assumed to be
|
|
149
|
+
/// already validated by another function. only for internal use. Unless you are
|
|
150
|
+
/// constructing an address from a primitive function of the FFI, you probably
|
|
151
|
+
/// shouldn't be using this..
|
|
152
|
+
init(validatedEncoding: String, networkType: NetworkType) {
|
|
153
|
+
self.encoding = validatedEncoding
|
|
154
|
+
self.networkType = networkType
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
extension UnifiedFullViewingKey {
|
|
159
|
+
/// This constructor is for internal use for Strings encodings that are assumed to be
|
|
160
|
+
/// already validated by another function. only for internal use. Unless you are
|
|
161
|
+
/// constructing an address from a primitive function of the FFI, you probably
|
|
162
|
+
/// shouldn't be using this.
|
|
163
|
+
init(validatedEncoding: String, account: UInt32) {
|
|
164
|
+
self.encoding = validatedEncoding
|
|
165
|
+
self.account = account
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
extension SaplingExtendedFullViewingKey {
|
|
170
|
+
/// This constructor is for internal use for Strings encodings that are assumed to be
|
|
171
|
+
/// already validated by another function. only for internal use. Unless you are
|
|
172
|
+
/// constructing an address from a primitive function of the FFI, you probably
|
|
173
|
+
/// shouldn't be using this.
|
|
174
|
+
init(validatedEncoding: String) {
|
|
175
|
+
self.encoding = validatedEncoding
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
extension SaplingExtendedSpendingKey {
|
|
180
|
+
/// This constructor is for internal use for Strings encodings that are assumed to be
|
|
181
|
+
/// already validated by another function. only for internal use. Unless you are
|
|
182
|
+
/// constructing an address from a primitive function of the FFI, you probably
|
|
183
|
+
/// shouldn't be using this.
|
|
184
|
+
init(validatedEncoding: String) {
|
|
185
|
+
self.encoding = validatedEncoding
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
public extension UnifiedSpendingKey {
|
|
190
|
+
func map<T>(_ transform: (UnifiedSpendingKey) throws -> T) rethrows -> T {
|
|
191
|
+
try transform(self)
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
public extension UnifiedAddress {
|
|
196
|
+
/// Extracts the sapling receiver from this UA if available
|
|
197
|
+
/// - Returns: an `Optional<SaplingAddress>`
|
|
198
|
+
func saplingReceiver() throws -> SaplingAddress {
|
|
199
|
+
try DerivationTool(networkType: networkType).saplingReceiver(from: self)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/// Extracts the transparent receiver from this UA if available
|
|
203
|
+
/// - Returns: an `Optional<TransparentAddress>`
|
|
204
|
+
func transparentReceiver() throws -> TransparentAddress {
|
|
205
|
+
try DerivationTool(networkType: networkType).transparentReceiver(from: self)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TransactionEncoder.swift
|
|
3
|
+
// ZcashLightClientKit
|
|
4
|
+
//
|
|
5
|
+
// Created by Francisco Gindre on 11/20/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
typealias TransactionEncoderResultBlock = (_ result: Result<EncodedTransaction, Error>) -> Void
|
|
11
|
+
|
|
12
|
+
public enum TransactionEncoderError: Error {
|
|
13
|
+
case notFound(transactionId: Int)
|
|
14
|
+
case notEncoded(transactionId: Int)
|
|
15
|
+
case missingParams
|
|
16
|
+
case spendingKeyWrongNetwork
|
|
17
|
+
case couldNotExpand(txId: Data)
|
|
18
|
+
case submitError(code: Int, message: String)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protocol TransactionEncoder {
|
|
22
|
+
/// Creates a transaction, throwing an exception whenever things are missing. When the provided wallet implementation
|
|
23
|
+
/// doesn't throw an exception, we wrap the issue into a descriptive exception ourselves (rather than using
|
|
24
|
+
/// double-bangs for things).
|
|
25
|
+
///
|
|
26
|
+
/// - Parameters:
|
|
27
|
+
/// - Parameter spendingKey: a `UnifiedSpendingKey` containing the spending key
|
|
28
|
+
/// - Parameter zatoshi: the amount to send in `Zatoshi`
|
|
29
|
+
/// - Parameter to: string containing the recipient address
|
|
30
|
+
/// - Parameter MemoBytes: string containing the memo (optional)
|
|
31
|
+
/// - Parameter accountIndex: index of the account that will be used to send the funds
|
|
32
|
+
/// - Throws:
|
|
33
|
+
/// - `walletTransEncoderCreateTransactionMissingSaplingParams` if the sapling parameters aren't downloaded.
|
|
34
|
+
/// - Some `ZcashError.rust*` if the creation of transaction fails.
|
|
35
|
+
func createTransaction(
|
|
36
|
+
spendingKey: UnifiedSpendingKey,
|
|
37
|
+
zatoshi: Zatoshi,
|
|
38
|
+
to address: String,
|
|
39
|
+
memoBytes: MemoBytes?,
|
|
40
|
+
from accountIndex: Int
|
|
41
|
+
) async throws -> ZcashTransaction.Overview
|
|
42
|
+
|
|
43
|
+
/// Creates a transaction that will attempt to shield transparent funds that are present on the blocks cache .throwing
|
|
44
|
+
/// an exception whenever things are missing. When the provided wallet implementation doesn't throw an exception,
|
|
45
|
+
/// we wrap the issue into a descriptive exception ourselves (rather than using double-bangs for things).
|
|
46
|
+
///
|
|
47
|
+
/// - Parameters:
|
|
48
|
+
/// - Parameter spendingKey: `UnifiedSpendingKey` to spend the UTXOs
|
|
49
|
+
/// - Parameter memoBytes: containing the memo (optional)
|
|
50
|
+
/// - Parameter accountIndex: index of the account that will be used to send the funds
|
|
51
|
+
/// - Throws:
|
|
52
|
+
/// - `walletTransEncoderShieldFundsMissingSaplingParams` if the sapling parameters aren't downloaded.
|
|
53
|
+
/// - Some `ZcashError.rust*` if the creation of transaction fails.
|
|
54
|
+
func createShieldingTransaction(
|
|
55
|
+
spendingKey: UnifiedSpendingKey,
|
|
56
|
+
shieldingThreshold: Zatoshi,
|
|
57
|
+
memoBytes: MemoBytes?,
|
|
58
|
+
from accountIndex: Int
|
|
59
|
+
) async throws -> ZcashTransaction.Overview
|
|
60
|
+
|
|
61
|
+
/// submits a transaction to the Zcash peer-to-peer network.
|
|
62
|
+
/// - Parameter transaction: a transaction overview
|
|
63
|
+
func submit(transaction: EncodedTransaction) async throws
|
|
64
|
+
|
|
65
|
+
func closeDBConnection()
|
|
66
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
//
|
|
2
|
+
// WalletTransactionEncoder.swift
|
|
3
|
+
// ZcashLightClientKit
|
|
4
|
+
//
|
|
5
|
+
// Created by Francisco Gindre on 11/20/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
class WalletTransactionEncoder: TransactionEncoder {
|
|
11
|
+
let lightWalletService: LightWalletService
|
|
12
|
+
let rustBackend: ZcashRustBackendWelding
|
|
13
|
+
let repository: TransactionRepository
|
|
14
|
+
let logger: Logger
|
|
15
|
+
|
|
16
|
+
private let outputParamsURL: URL
|
|
17
|
+
private let spendParamsURL: URL
|
|
18
|
+
private let dataDbURL: URL
|
|
19
|
+
private let fsBlockDbRoot: URL
|
|
20
|
+
private let networkType: NetworkType
|
|
21
|
+
|
|
22
|
+
init(
|
|
23
|
+
rustBackend: ZcashRustBackendWelding,
|
|
24
|
+
dataDb: URL,
|
|
25
|
+
fsBlockDbRoot: URL,
|
|
26
|
+
service: LightWalletService,
|
|
27
|
+
repository: TransactionRepository,
|
|
28
|
+
outputParams: URL,
|
|
29
|
+
spendParams: URL,
|
|
30
|
+
networkType: NetworkType,
|
|
31
|
+
logger: Logger
|
|
32
|
+
) {
|
|
33
|
+
self.rustBackend = rustBackend
|
|
34
|
+
self.dataDbURL = dataDb
|
|
35
|
+
self.fsBlockDbRoot = fsBlockDbRoot
|
|
36
|
+
self.lightWalletService = service
|
|
37
|
+
self.repository = repository
|
|
38
|
+
self.outputParamsURL = outputParams
|
|
39
|
+
self.spendParamsURL = spendParams
|
|
40
|
+
self.networkType = networkType
|
|
41
|
+
self.logger = logger
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
convenience init(initializer: Initializer) {
|
|
45
|
+
self.init(
|
|
46
|
+
rustBackend: initializer.rustBackend,
|
|
47
|
+
dataDb: initializer.dataDbURL,
|
|
48
|
+
fsBlockDbRoot: initializer.fsBlockDbRoot,
|
|
49
|
+
service: initializer.lightWalletService,
|
|
50
|
+
repository: initializer.transactionRepository,
|
|
51
|
+
outputParams: initializer.outputParamsURL,
|
|
52
|
+
spendParams: initializer.spendParamsURL,
|
|
53
|
+
networkType: initializer.network.networkType,
|
|
54
|
+
logger: initializer.logger
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
func createTransaction(
|
|
59
|
+
spendingKey: UnifiedSpendingKey,
|
|
60
|
+
zatoshi: Zatoshi,
|
|
61
|
+
to address: String,
|
|
62
|
+
memoBytes: MemoBytes?,
|
|
63
|
+
from accountIndex: Int
|
|
64
|
+
) async throws -> ZcashTransaction.Overview {
|
|
65
|
+
let txId = try await createSpend(
|
|
66
|
+
spendingKey: spendingKey,
|
|
67
|
+
zatoshi: zatoshi,
|
|
68
|
+
to: address,
|
|
69
|
+
memoBytes: memoBytes,
|
|
70
|
+
from: accountIndex
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
logger.debug("transaction id: \(txId)")
|
|
74
|
+
return try await repository.find(id: txId)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
func createSpend(
|
|
78
|
+
spendingKey: UnifiedSpendingKey,
|
|
79
|
+
zatoshi: Zatoshi,
|
|
80
|
+
to address: String,
|
|
81
|
+
memoBytes: MemoBytes?,
|
|
82
|
+
from accountIndex: Int
|
|
83
|
+
) async throws -> Int {
|
|
84
|
+
guard ensureParams(spend: self.spendParamsURL, output: self.outputParamsURL) else {
|
|
85
|
+
throw ZcashError.walletTransEncoderCreateTransactionMissingSaplingParams
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let txId = try await rustBackend.createToAddress(
|
|
89
|
+
usk: spendingKey,
|
|
90
|
+
to: address,
|
|
91
|
+
value: zatoshi.amount,
|
|
92
|
+
memo: memoBytes
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return Int(txId)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
func createShieldingTransaction(
|
|
99
|
+
spendingKey: UnifiedSpendingKey,
|
|
100
|
+
shieldingThreshold: Zatoshi,
|
|
101
|
+
memoBytes: MemoBytes?,
|
|
102
|
+
from accountIndex: Int
|
|
103
|
+
) async throws -> ZcashTransaction.Overview {
|
|
104
|
+
let txId = try await createShieldingSpend(
|
|
105
|
+
spendingKey: spendingKey,
|
|
106
|
+
shieldingThreshold: shieldingThreshold,
|
|
107
|
+
memo: memoBytes,
|
|
108
|
+
accountIndex: accountIndex
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
logger.debug("transaction id: \(txId)")
|
|
112
|
+
return try await repository.find(id: txId)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
func createShieldingSpend(
|
|
116
|
+
spendingKey: UnifiedSpendingKey,
|
|
117
|
+
shieldingThreshold: Zatoshi,
|
|
118
|
+
memo: MemoBytes?,
|
|
119
|
+
accountIndex: Int
|
|
120
|
+
) async throws -> Int {
|
|
121
|
+
guard ensureParams(spend: self.spendParamsURL, output: self.outputParamsURL) else {
|
|
122
|
+
throw ZcashError.walletTransEncoderShieldFundsMissingSaplingParams
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
let txId = try await rustBackend.shieldFunds(
|
|
126
|
+
usk: spendingKey,
|
|
127
|
+
memo: memo,
|
|
128
|
+
shieldingThreshold: shieldingThreshold
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
return Int(txId)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
func submit(
|
|
135
|
+
transaction: EncodedTransaction
|
|
136
|
+
) async throws {
|
|
137
|
+
let response = try await self.lightWalletService.submit(spendTransaction: transaction.raw)
|
|
138
|
+
|
|
139
|
+
guard response.errorCode >= 0 else {
|
|
140
|
+
throw TransactionEncoderError.submitError(code: Int(response.errorCode), message: response.errorMessage)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
func ensureParams(spend: URL, output: URL) -> Bool {
|
|
145
|
+
let readableSpend = FileManager.default.isReadableFile(atPath: spend.path)
|
|
146
|
+
let readableOutput = FileManager.default.isReadableFile(atPath: output.path)
|
|
147
|
+
|
|
148
|
+
// TODO: [#713] change this to something that makes sense, https://github.com/zcash/ZcashLightClientKit/issues/713
|
|
149
|
+
return readableSpend && readableOutput
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
func closeDBConnection() {
|
|
153
|
+
self.repository.closeDBConnection()
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
extension ZcashTransaction.Overview {
|
|
158
|
+
func encodedTransaction() throws -> EncodedTransaction {
|
|
159
|
+
guard let raw else {
|
|
160
|
+
throw TransactionEncoderError.notEncoded(transactionId: self.id)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return EncodedTransaction(transactionId: self.rawID, raw: raw)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AsyncToClosureGateway.swift
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Michal Fousek on 03.04.2023.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
enum AsyncToClosureGateway {
|
|
11
|
+
static func executeAction(_ completion: @escaping () -> Void, action: @escaping () async -> Void) {
|
|
12
|
+
Task {
|
|
13
|
+
await action()
|
|
14
|
+
completion()
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static func executeAction<R>(_ completion: @escaping (R) -> Void, action: @escaping () async -> R) {
|
|
19
|
+
Task {
|
|
20
|
+
let result = await action()
|
|
21
|
+
completion(result)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static func executeThrowingAction(_ completion: @escaping (Error?) -> Void, action: @escaping () async throws -> Void) {
|
|
26
|
+
Task {
|
|
27
|
+
do {
|
|
28
|
+
try await action()
|
|
29
|
+
completion(nil)
|
|
30
|
+
} catch {
|
|
31
|
+
completion(error)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static func executeThrowingAction<R>(_ completion: @escaping (Result<R, Error>) -> Void, action: @escaping () async throws -> R) {
|
|
37
|
+
Task {
|
|
38
|
+
do {
|
|
39
|
+
let result = try await action()
|
|
40
|
+
completion(.success(result))
|
|
41
|
+
} catch {
|
|
42
|
+
completion(.failure(error))
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AsyncToCombineGateway.swift
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Michal Fousek on 03.04.2023.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Combine
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
enum AsyncToCombineGateway {
|
|
12
|
+
static func executeAction(action: @escaping () async -> Void) -> CompletablePublisher<Never> {
|
|
13
|
+
let subject = PassthroughSubject<Void, Never>()
|
|
14
|
+
Task {
|
|
15
|
+
await action()
|
|
16
|
+
subject.send(completion: .finished)
|
|
17
|
+
}
|
|
18
|
+
return subject.eraseToAnyPublisher()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static func executeAction<R>(action: @escaping () async -> R) -> SinglePublisher<R, Never> {
|
|
22
|
+
let subject = PassthroughSubject<R, Never>()
|
|
23
|
+
Task {
|
|
24
|
+
let result = await action()
|
|
25
|
+
subject.send(result)
|
|
26
|
+
subject.send(completion: .finished)
|
|
27
|
+
}
|
|
28
|
+
return subject.eraseToAnyPublisher()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static func executeThrowingAction(action: @escaping () async throws -> Void) -> CompletablePublisher<Error> {
|
|
32
|
+
let subject = PassthroughSubject<Void, Error>()
|
|
33
|
+
Task {
|
|
34
|
+
do {
|
|
35
|
+
try await action()
|
|
36
|
+
subject.send(completion: .finished)
|
|
37
|
+
} catch {
|
|
38
|
+
subject.send(completion: .failure(error))
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return subject.eraseToAnyPublisher()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static func executeThrowingAction<R>(action: @escaping () async throws -> R) -> SinglePublisher<R, Error> {
|
|
46
|
+
let subject = PassthroughSubject<R, Error>()
|
|
47
|
+
Task {
|
|
48
|
+
do {
|
|
49
|
+
let result = try await action()
|
|
50
|
+
subject.send(result)
|
|
51
|
+
subject.send(completion: .finished)
|
|
52
|
+
} catch {
|
|
53
|
+
subject.send(completion: .failure(error))
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return subject.eraseToAnyPublisher()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Clamped.swift
|
|
3
|
+
// secant-testnet
|
|
4
|
+
//
|
|
5
|
+
// Created by Francisco Gindre on 10/20/21.
|
|
6
|
+
//
|
|
7
|
+
// credits: https://iteo.medium.com/swift-property-wrappers-how-to-use-them-right-77095817d1b
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Limits a value to an enclosing range
|
|
12
|
+
*/
|
|
13
|
+
@propertyWrapper
|
|
14
|
+
public struct Clamped<Value: Comparable> {
|
|
15
|
+
private var value: Value
|
|
16
|
+
private let range: ClosedRange<Value>
|
|
17
|
+
public var wrappedValue: Value {
|
|
18
|
+
get { value }
|
|
19
|
+
set { value = clamp(newValue, using: range) }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
init(wrappedValue: Value, _ range: ClosedRange<Value>) {
|
|
23
|
+
self.value = wrappedValue
|
|
24
|
+
self.range = range
|
|
25
|
+
|
|
26
|
+
value = clamp(wrappedValue, using: range)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private func clamp(_ value: Value, using range: ClosedRange<Value>) -> Value {
|
|
30
|
+
min(range.upperBound, max(range.lowerBound, value))
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DIContainer.swift
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Michal Fousek on 01.05.2023.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
/// This class represents depedency injection containers.
|
|
11
|
+
class DIContainer {
|
|
12
|
+
/// Structure that represents one registered dependency.
|
|
13
|
+
struct Dependency {
|
|
14
|
+
/// Closure which creates instance of the dependency.
|
|
15
|
+
let factory: (DIContainer) -> Any
|
|
16
|
+
/// Indicates if dependency is singleton. If this is `true` then `DIContainer` creates only one instance of this dependency and returns
|
|
17
|
+
/// it every time `resolve()` for the dependency is called.
|
|
18
|
+
let isSingleton: Bool
|
|
19
|
+
/// If the dependency is singleton then instance is stored here.
|
|
20
|
+
let instance: Any?
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/// If this is `true` then `mockedDependencies` is used first to resolve dependencies. This is used for mocking in tests.
|
|
24
|
+
var isTestEnvironment = false
|
|
25
|
+
|
|
26
|
+
private let lock = NSRecursiveLock()
|
|
27
|
+
/// Dependencies are stored here.
|
|
28
|
+
private var dependencies: [String: Dependency] = [:]
|
|
29
|
+
/// Mocked dependencies are stored here.
|
|
30
|
+
private var mockedDependencies: [String: Dependency] = [:]
|
|
31
|
+
|
|
32
|
+
init() { }
|
|
33
|
+
|
|
34
|
+
private func key<T>(for type: T.Type) -> String {
|
|
35
|
+
return String(describing: T.self)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
func register<T>(type: T.Type, isSingleton: Bool, factory: @escaping (DIContainer) -> T) {
|
|
39
|
+
lock.lock()
|
|
40
|
+
let key = self.key(for: type)
|
|
41
|
+
let depedency = Dependency(factory: factory, isSingleton: isSingleton, instance: nil)
|
|
42
|
+
dependencies[key] = depedency
|
|
43
|
+
lock.unlock()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
func mock<T>(type: T.Type, isSingleton: Bool, factory: @escaping (DIContainer) -> T) {
|
|
47
|
+
lock.lock()
|
|
48
|
+
let key = self.key(for: type)
|
|
49
|
+
let depedency = Dependency(factory: factory, isSingleton: isSingleton, instance: nil)
|
|
50
|
+
mockedDependencies[key] = depedency
|
|
51
|
+
lock.unlock()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
func resolve<T>(_ type: T.Type) -> T {
|
|
55
|
+
lock.lock()
|
|
56
|
+
defer { lock.unlock() }
|
|
57
|
+
let key = self.key(for: type)
|
|
58
|
+
|
|
59
|
+
let possibleDependency = (isTestEnvironment ? mockedDependencies[key] : dependencies[key]) ?? dependencies[key]
|
|
60
|
+
guard let dependency = possibleDependency else {
|
|
61
|
+
// When dependency is resolved before it's registered then the app crashes. It would be possible to not crash and throw some error here.
|
|
62
|
+
// But it complicates the rest of the code. And maybe it doesn't make sense because this kind of error is not recoverable. It can be fixed
|
|
63
|
+
// only by updating the code.
|
|
64
|
+
fatalError("Doesn't have registered dependency for type \(type).")
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let instance: Any
|
|
68
|
+
if dependency.isSingleton, let singleton = dependency.instance {
|
|
69
|
+
instance = singleton
|
|
70
|
+
} else {
|
|
71
|
+
instance = dependency.factory(self)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if dependency.isSingleton && dependency.instance == nil {
|
|
75
|
+
dependencies[key] = Dependency(factory: dependency.factory, isSingleton: dependency.isSingleton, instance: instance)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
guard let instance = instance as? T else {
|
|
79
|
+
// When dependency is resolved but instance of created depedency is different than expected type the app crashes. It would be possible to
|
|
80
|
+
// not crash and throw some error here. But it complicates the rest of the code. And maybe it doesn't make sense because this kind of
|
|
81
|
+
// error is not recoverable. It can be fixed only by updating the code.
|
|
82
|
+
fatalError("Getting dependency for type \(type) but created instance is \(instance)")
|
|
83
|
+
}
|
|
84
|
+
return instance
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GenericActor.swift
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Michal Fousek on 20.03.2023.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
actor GenericActor<T> {
|
|
11
|
+
var value: T
|
|
12
|
+
init(_ value: T) { self.value = value }
|
|
13
|
+
func update(_ newValue: T) async -> T {
|
|
14
|
+
let oldValue = value
|
|
15
|
+
value = newValue
|
|
16
|
+
return oldValue
|
|
17
|
+
}
|
|
18
|
+
}
|