react-native-zcash 0.9.12 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/android/build.gradle +6 -6
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3100000.json +8 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3110000.json +8 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3120000.json +8 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/3130000.json +8 -0
- package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +126 -69
- package/ios/RNZcash.m +0 -5
- package/ios/RNZcash.swift +153 -104
- package/ios/ZCashLightClientKit/Account/Account.swift +48 -0
- package/ios/ZCashLightClientKit/Account/AccountMetadataKey.swift +96 -0
- package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +23 -4
- package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +6 -2
- package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +4 -2
- package/ios/ZCashLightClientKit/Block/Actions/ValidateServerAction.swift +4 -1
- package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +83 -16
- package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +4 -2
- package/ios/ZCashLightClientKit/Block/Download/BlockDownloaderService.swift +22 -19
- package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +50 -19
- package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +5 -3
- package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +22 -5
- package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +2 -1
- package/ios/ZCashLightClientKit/Block/Utils/CompactBlockProgress.swift +5 -3
- package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +88 -0
- package/ios/ZCashLightClientKit/Checkpoint/CheckpointSource.swift +4 -0
- package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +52 -21
- package/ios/ZCashLightClientKit/CombineSynchronizer.swift +49 -27
- package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +8 -2
- package/ios/ZCashLightClientKit/DAO/BlockDao.swift +65 -0
- package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +86 -1
- package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +4 -4
- package/ios/ZCashLightClientKit/Entity/Pczt.swift +10 -0
- package/ios/ZCashLightClientKit/Entity/SentNoteEntity.swift +2 -2
- package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +40 -16
- package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +1 -1
- package/ios/ZCashLightClientKit/Error/ZcashError.swift +182 -14
- package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +63 -5
- package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +122 -12
- package/ios/ZCashLightClientKit/Initializer.swift +49 -14
- package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +15 -6
- package/ios/ZCashLightClientKit/Model/SingleUseTransparentAddress.swift +29 -0
- package/ios/ZCashLightClientKit/Model/TransactionDataRequest.swift +83 -2
- package/ios/ZCashLightClientKit/Model/WalletSummary.swift +21 -4
- package/ios/ZCashLightClientKit/Model/WalletTypes.swift +38 -8
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +177 -45
- package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +63 -16
- package/ios/ZCashLightClientKit/Modules/Service/Tor/LightWalletGRPCServiceOverTor.swift +273 -0
- package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +5 -2
- package/ios/ZCashLightClientKit/Repository/TransactionRepository.swift +2 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2675000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2677500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2682500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2685000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2687500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2692500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2695000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2697500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2702500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2705000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2707500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2712500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2715000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2717500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2722500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2725000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2727500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2732500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2735000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2737500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2742500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2745000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2747500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2752500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2755000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2757500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2762500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2765000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2767500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2772500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2775000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2777500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2782500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2785000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2787500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2792500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2795000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2797500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2802500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2805000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2807500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2812500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2815000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2817500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2822500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2825000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2827500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2832500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2835000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2837500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2842500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2845000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2847500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2852500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2855000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2857500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2862500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2865000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2867500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2872500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2875000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2877500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2882500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2885000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2887500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2892500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2895000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2897500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2902500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2905000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2907500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2912500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2915000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2917500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2922500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2925000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2927500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2932500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2935000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2937500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2942500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2945000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2947500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2952500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2955000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2957500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2962500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2965000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2967500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2972500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2975000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2977500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2982500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2985000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2987500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2992500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2995000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2997500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3002500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3005000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3007500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3012500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3015000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3017500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3022500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3025000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3027500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3032500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3035000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3037500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3042500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3045000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3047500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3052500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3055000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3057500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3062500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3065000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3067500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3072500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3075000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3077500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3082500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3085000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3087500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3092500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3095000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3097500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3100000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3102500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3105000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3107500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3110000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3112500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3115000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3117500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3120000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3122500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3125000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3127500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/3130000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3010000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3020000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3030000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3040000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3050000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3060000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3070000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3080000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3090000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3100000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3110000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3120000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3130000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3140000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3150000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3160000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3170000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3180000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3190000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3200000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3210000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3220000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3230000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3240000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3250000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3260000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3270000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3280000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3290000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3300000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3310000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3320000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3330000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3340000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3350000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3360000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3370000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3380000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3390000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3400000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3410000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3420000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3430000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3440000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3450000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3460000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3470000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3480000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3490000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3500000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3510000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3520000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3530000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3540000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3550000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3560000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3570000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3580000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3590000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3600000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3610000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3620000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3630000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3640000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3650000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3660000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/3670000.json +8 -0
- package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +89 -10
- package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackendWelding.swift +39 -3
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +532 -74
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +97 -14
- package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +104 -28
- package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +105 -31
- package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +36 -9
- package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +401 -175
- package/ios/ZCashLightClientKit/Synchronizer.swift +192 -69
- package/ios/ZCashLightClientKit/Tool/DerivationTool.swift +69 -12
- package/ios/ZCashLightClientKit/Tor/TorClient.swift +502 -11
- package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +10 -6
- package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +24 -9
- package/ios/ZCashLightClientKit/Utils/SDKFlags.swift +71 -0
- package/ios/libzcashlc.xcframework/Info.plist +5 -5
- 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/zcashlc.h +1640 -378
- package/lib/rnzcash.rn.js.map +1 -1
- package/lib/src/react-native.d.ts +2 -2
- package/lib/src/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/react-native.ts +2 -3
- package/src/types.ts +2 -0
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
def kotlinVersion = rootProject.ext.has('kotlinVersion')
|
|
3
3
|
? rootProject.ext.get('kotlinVersion')
|
|
4
|
-
: '1.
|
|
4
|
+
: '2.1.10'
|
|
5
5
|
|
|
6
6
|
repositories {
|
|
7
7
|
mavenCentral()
|
|
8
8
|
google()
|
|
9
9
|
}
|
|
10
10
|
dependencies {
|
|
11
|
-
classpath 'com.android.tools.build:gradle:
|
|
11
|
+
classpath 'com.android.tools.build:gradle:8.5.0'
|
|
12
12
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -22,10 +22,10 @@ def safeExtGet(prop, fallback) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
android {
|
|
25
|
-
compileSdkVersion safeExtGet('compileSdkVersion',
|
|
25
|
+
compileSdkVersion safeExtGet('compileSdkVersion', 35)
|
|
26
26
|
defaultConfig {
|
|
27
27
|
minSdkVersion safeExtGet('minSdkVersion', 27)
|
|
28
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
28
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 35)
|
|
29
29
|
}
|
|
30
30
|
lintOptions {
|
|
31
31
|
abortOnError false
|
|
@@ -49,8 +49,8 @@ dependencies {
|
|
|
49
49
|
|
|
50
50
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
51
51
|
implementation 'androidx.paging:paging-runtime-ktx:2.1.2'
|
|
52
|
-
implementation 'cash.z.ecc.android:zcash-android-sdk:2.
|
|
53
|
-
implementation 'cash.z.ecc.android:zcash-android-sdk-incubator:2.
|
|
52
|
+
implementation 'cash.z.ecc.android:zcash-android-sdk:2.4.0'
|
|
53
|
+
implementation 'cash.z.ecc.android:zcash-android-sdk-incubator:2.4.0'
|
|
54
54
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
|
|
55
55
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3"
|
|
56
56
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "main",
|
|
3
|
+
"height": "3100000",
|
|
4
|
+
"hash": "0000000000d3ec630284af279924f250a48c07a65493b08c49ae097cfec56d0d",
|
|
5
|
+
"time": 1760518380,
|
|
6
|
+
"saplingTree": "017f67c92f020077806a4c1bed02ec17436908a51ea85215eb5044bde3260cc539001f000001a31d1f50fdb9c5ad38082a4a92c7ec0bd9bd525c0a72ce3a8a4b75bedba60a54014a37c9eeb58e29d404204f66ab9f2bc3af7691470210860541ea9e54f138e62c01ec408c94dafd7c3cc48db28d4e98488c97187f88ceb344013a2c9bc43e53304500011061719a3e398fb6a27fdad8a3680ef8425636aa16dc46e98e448d69f686a4690142ff2ce994319271ee2007c657c73e8c89c1421ecf4d21b636a19733d302b42b0100e9c650ad359ffddaf4a41f8a833984c46ce1eba38d9496d5b6fb84628869250000013f2e766adb2754f0eaf48794466b744503f8d9373ec95a74c2382d18326b8859000128423c48fcf66ca650c3aa306cbb3f8c1ae1cbc9ae88c6349bf80790c09db153000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
|
|
7
|
+
"orchardTree": "01d5c6e17e9a1283828c85fad1b09a1e05cabc14d1d957832fba00fdd642d9423f001f01504988bc141e42b941cf732685fdb5cd83ccf96b631b81b387516ac4cbcab12300000001cf7b8170f25fb32ae19c0142f2fbf133dc8a49c991e6e402ad78afd70e67b63b0001ab3ec9df965a99fef0d67366b392b83d588898650277258e072502fb909f900d000000018fc5ce26028d08258156f301b017c2b1bb538bedf61ef32dda851b2bf806170201dd217a863037557863de62b406c90d632e89017d88f4e11a3263880bedf2c00701e3828bc800464ef4aebe4c587f127fb7bff22194d72e192e5c5fb0a09f7f5d09000000000000017c8ece2b2ab2355d809b58809b21c7a5e95cfc693cd689387f7533ec8749261e01cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "main",
|
|
3
|
+
"height": "3110000",
|
|
4
|
+
"hash": "0000000000a5f69508e3dd5c75855598ce2a0222f59c8a7446d289809e85255b",
|
|
5
|
+
"time": 1761271810,
|
|
6
|
+
"saplingTree": "01e4c151a1c849458baaa9387badf2b0367ce7a7280e145f3f6d9e853af1673a6b001f01adc1de18078d9387a8da396f0a1ac145d92d79c0829b8631fb46ea9bb29d573200016599f4b893f250f81c4f43fa49e622985b18a57e1abdf79cadc9b9e9a6c4e10f00017654745409d8507d48f50885aaa3cf44af6e8e5b2add8e4130bbcf3d9b9e14480124a1b4f5313b51fd5bca0206d234b9185e1c99171eb28dfa457e51eac9618f39000000019d6b3daed617409542252505380d86a7c6c5ecb8301d9aaa65da5de0da87760f000001fd4c4391cb31054d9ebea02406bdae95e15579e74bff7e8c75a1ffbb1182283b0128423c48fcf66ca650c3aa306cbb3f8c1ae1cbc9ae88c6349bf80790c09db153000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
|
|
7
|
+
"orchardTree": "015560be343171a51901db0445758e8a8034a917be650531137e23880411aebd2d001f01c4ae1a3ea3e57eb7955b32d4e056fa828213f6c8327b47ddb39da4d69e08212401517b0d1d54ad2629bc2958f25f964c32aa13fd759cece7665daceff1497eec17010f9e835162a770274c3e156346da5d22e14298781c1aa0b57c166be069404b29000000015e4118f22d6f7bc8d94b076604b778625981e79cad4dd47bf334f9053d1ffb3a015fd3052ee12c95a5a6db6e648f6b90e340cbedc5e8470ee358e52a3dc356ce33000189bcc9071e24d253c015b2d6af75bc9d6c10d237c27ad4fcbf02fd87dfdadd1800013158d33bf2b325a60a67cb6215ee7cfd02b8444bfed4b42abc952541b74b3110019de19ec833da103e00044cf190979363ccc06a76605ef988662590a2cf7967220001bc414c78067c0b4f24881574214efac7ac4da3f6155e21ce5c7f741f804af60a00000000017c8ece2b2ab2355d809b58809b21c7a5e95cfc693cd689387f7533ec8749261e01cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "main",
|
|
3
|
+
"height": "3120000",
|
|
4
|
+
"hash": "0000000000d4b95b78bb97c861f4e529cc8641ffdf8154f352620a52055fedf8",
|
|
5
|
+
"time": 1762025383,
|
|
6
|
+
"saplingTree": "01520d96905d34f25a71db6eaea3ace810f9e4e29d09b8d6ea10375c0fca164a2b001f01ed9d4e79852980b7f07cb96b17a56ea604c6a926e7429d60d7863462b4c78853015a191b9d7a06aed858bda9dd63519a2199403a5c150b19e63bc7bbe768301b600000000001e36845c79c1a6ddc0c556eaf44fd955ae5de4987585834ae6f433ed950a85e1f01d5e99ee9233411a7c786fdd75881270dde26142f1c61788d7f8aa74dde39336400018c88b762921da5bdc8095da05c9b974c815982eed2162e084908602680fb4d6f0001fac3b6c4f0946f8f406437b5ea0066ceaffc81436dcd66a5cad0d1c87e04625c01fd4c4391cb31054d9ebea02406bdae95e15579e74bff7e8c75a1ffbb1182283b0128423c48fcf66ca650c3aa306cbb3f8c1ae1cbc9ae88c6349bf80790c09db153000001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
|
|
7
|
+
"orchardTree": "0118f9e8b5107d121611121b5484af934c09825d3e9005939d34cae7cc0a5ee00001a413d42ba77e53b3a6751e127a00a39cb07878b7c8c36cad49d514b212eeae3c1f01581a4f0d2c27e63fd8fcf2e51322460c66807b93d41698c12da589171b064e1701437e00d9cc5ac61feaa398670ac371504a6581c45a9470e71d91536cfba05e220001829128b1125cb4525c4ae25e727d9c7e0c87fe14a3d4679b4c5c2b3a7ac581270000000000000132944433245163a348ecbedf7c482bc0b9d74c59e5a6c5bbfb45e3a7bffe563100000157c093e1ae4cc242db6eed0eefebbb7dc6571ae35a7d35040d9ab24fc305a63800017852cc0085e68db25ad9fa1b63a310463c148e07140f600bc2779971b21d2211000000017c8ece2b2ab2355d809b58809b21c7a5e95cfc693cd689387f7533ec8749261e01cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"network": "main",
|
|
3
|
+
"height": "3130000",
|
|
4
|
+
"hash": "0000000000ef4e1eb5738c3bd0db88bb6e6a19cdc1e3c0e665d557a643afe173",
|
|
5
|
+
"time": 1762778627,
|
|
6
|
+
"saplingTree": "0115e0b53bb054be5004ff2f1ef130c7bb4bd5c13160f058fa08f4887cc680974e01f86c92c25efef689a7da41e72cde3a22bdf217f4b3f373c76bf764b9a16531001f000000000001223296c894014e7b74bc6a1ea13a1f5e1f3c8e1e2c7054e9aef18f3cb24a7120000001d50edf1002f4e8c2a36e04279b1bdf1a856afaa1e742d8a186c619c500c5d735000188ab63dddc016b9eafeacb0c31a6225f86433af6bfeb1dbbba2116c756e2e4280000000194ba2edf2d7ccac96720733e47705dcdf8861639357e16599e294b1b5222765c0001931c48ea50688eae5e54c24d0df7a6b00ce498f92eb5e1cfd6a2d87d8ebd5364017d1ce2f0839bdbf1bad7ae37f845e7fe2116e0c1197536bfbad549f3876c3c590000013e2598f743726006b8de42476ed56a55a75629a7b82e430c4e7c101a69e9b02a011619f99023a69bb647eab2d2aa1a73c3673c74bb033c3c4930eacda19e6fd93b0000000160272b134ca494b602137d89e528c751c06d3ef4a87a45f33af343c15060cc1e0000000000",
|
|
7
|
+
"orchardTree": "01904cb5adb532dd53cfd62ddd526f2962591953d3b46a94b5c9a76df075aac13f001f000001bf3361530e303d4d5c98a7632b3689cebab6bb483c457ce047d8df99e3078d0501026fd02680012c3eef695c4cb55670430e850f63549fb960912e37a90b747938014dc12d7cc7ad433c695de1b21b04e2c01c8ce1ffdc87a5a91e0421d0c407c003000001bbeeb7b2a0d2de54595f2c50660a829792c1fa3b2520cf33b3ae3f7f12c7541801bef8700b622f8e5d4b2ba937d4640dc3ac60c1fbd54943df2bd3e0b058a593030001ec9103be2788c06f06aa5a76a072d88a2ca76fb4897157addf68df0d83657b06015c8789d27ee4405e38d33a59037dd9e3f47c008738017d20f61f7ea63ff33e010000000001905ae252612cb76b216003da1312a47b95d56eeb72207dbe5a809e53032157270000017c8ece2b2ab2355d809b58809b21c7a5e95cfc693cd689387f7533ec8749261e01cc2dcaa338b312112db04b435a706d63244dd435238f0aa1e9e1598d35470810012dcc4273c8a0ed2337ecf7879380a07e7d427c7f9d82e538002bd1442978402c01daf63debf5b40df902dae98dadc029f281474d190cddecef1b10653248a234150001e2bca6a8d987d668defba89dc082196a922634ed88e065c669e526bb8815ee1b000000000000"
|
|
8
|
+
}
|
|
@@ -12,7 +12,6 @@ import cash.z.ecc.android.sdk.type.*
|
|
|
12
12
|
import co.electriccoin.lightwallet.client.LightWalletClient
|
|
13
13
|
import co.electriccoin.lightwallet.client.model.LightWalletEndpoint
|
|
14
14
|
import co.electriccoin.lightwallet.client.model.Response
|
|
15
|
-
import co.electriccoin.lightwallet.client.new
|
|
16
15
|
import com.facebook.react.bridge.*
|
|
17
16
|
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
18
17
|
import kotlinx.coroutines.CoroutineScope
|
|
@@ -33,6 +32,15 @@ class RNZcashModule(
|
|
|
33
32
|
private var moduleScope: CoroutineScope = CoroutineScope(Dispatchers.IO)
|
|
34
33
|
private var synchronizerMap = mutableMapOf<String, SdkSynchronizer>()
|
|
35
34
|
|
|
35
|
+
// Track emitted transactions per alias to only emit new or updated transactions
|
|
36
|
+
private val emittedTransactions = mutableMapOf<String, MutableMap<String, EmittedTxState>>()
|
|
37
|
+
|
|
38
|
+
// Data class to track what we've emitted for each transaction
|
|
39
|
+
private data class EmittedTxState(
|
|
40
|
+
val minedHeight: BlockHeight?,
|
|
41
|
+
val transactionState: TransactionState,
|
|
42
|
+
)
|
|
43
|
+
|
|
36
44
|
private val networks = mapOf("mainnet" to ZcashNetwork.Mainnet, "testnet" to ZcashNetwork.Testnet)
|
|
37
45
|
|
|
38
46
|
override fun getName() = "RNZcash"
|
|
@@ -57,13 +65,19 @@ class RNZcashModule(
|
|
|
57
65
|
if (!synchronizerMap.containsKey(alias)) {
|
|
58
66
|
synchronizerMap[alias] =
|
|
59
67
|
Synchronizer.new(
|
|
60
|
-
reactApplicationContext,
|
|
61
|
-
network,
|
|
62
68
|
alias,
|
|
63
|
-
endpoint,
|
|
64
|
-
seedPhrase.toByteArray(),
|
|
65
69
|
BlockHeight.new(birthdayHeight.toLong()),
|
|
70
|
+
reactApplicationContext,
|
|
71
|
+
endpoint,
|
|
72
|
+
AccountCreateSetup(
|
|
73
|
+
accountName = alias,
|
|
74
|
+
keySource = null,
|
|
75
|
+
seed = FirstClassByteArray(seedPhrase.toByteArray()),
|
|
76
|
+
),
|
|
66
77
|
initMode,
|
|
78
|
+
network,
|
|
79
|
+
false, // isTorEnabled
|
|
80
|
+
false, // isExchangeRateEnabled
|
|
67
81
|
) as SdkSynchronizer
|
|
68
82
|
}
|
|
69
83
|
val wallet = getWallet(alias)
|
|
@@ -90,11 +104,39 @@ class RNZcashModule(
|
|
|
90
104
|
args.putString("name", status.toString())
|
|
91
105
|
}
|
|
92
106
|
}
|
|
93
|
-
wallet.
|
|
107
|
+
wallet.allTransactions.collectWith(scope) { txList ->
|
|
94
108
|
scope.launch {
|
|
109
|
+
// Get or create the tracking map for this alias
|
|
110
|
+
val emittedForAlias = emittedTransactions.getOrPut(alias) { mutableMapOf() }
|
|
111
|
+
|
|
112
|
+
val transactionsToEmit = mutableListOf<TransactionOverview>()
|
|
113
|
+
|
|
114
|
+
txList.forEach { tx ->
|
|
115
|
+
val txId = tx.txId.txIdString()
|
|
116
|
+
val previousState = emittedForAlias[txId]
|
|
117
|
+
|
|
118
|
+
// Check if this is a new transaction or if minedHeight/transactionState changed
|
|
119
|
+
val isNew = previousState == null
|
|
120
|
+
val minedHeightChanged = previousState?.minedHeight != tx.minedHeight
|
|
121
|
+
val stateChanged = previousState?.transactionState != tx.transactionState
|
|
122
|
+
|
|
123
|
+
if (isNew || minedHeightChanged || stateChanged) {
|
|
124
|
+
transactionsToEmit.add(tx)
|
|
125
|
+
// Update our tracking
|
|
126
|
+
emittedForAlias[txId] =
|
|
127
|
+
EmittedTxState(
|
|
128
|
+
minedHeight = tx.minedHeight,
|
|
129
|
+
transactionState = tx.transactionState,
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (transactionsToEmit.isEmpty()) {
|
|
135
|
+
return@launch
|
|
136
|
+
}
|
|
137
|
+
|
|
95
138
|
val nativeArray = Arguments.createArray()
|
|
96
|
-
|
|
97
|
-
.filter { tx -> tx.transactionState != TransactionState.Expired }
|
|
139
|
+
transactionsToEmit
|
|
98
140
|
.map { tx ->
|
|
99
141
|
launch {
|
|
100
142
|
val parsedTx = parseTx(wallet, tx)
|
|
@@ -104,27 +146,15 @@ class RNZcashModule(
|
|
|
104
146
|
|
|
105
147
|
sendEvent("TransactionEvent") { args ->
|
|
106
148
|
args.putString("alias", alias)
|
|
107
|
-
args.putArray(
|
|
108
|
-
"transactions",
|
|
109
|
-
nativeArray,
|
|
110
|
-
)
|
|
149
|
+
args.putArray("transactions", nativeArray)
|
|
111
150
|
}
|
|
112
151
|
}
|
|
113
152
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return@combine Balances(
|
|
120
|
-
transparentBalance = transparentBalance,
|
|
121
|
-
saplingBalances = saplingBalances,
|
|
122
|
-
orchardBalances = orchardBalances,
|
|
123
|
-
)
|
|
124
|
-
}.collectWith(scope) { map ->
|
|
125
|
-
val transparentBalance = map.transparentBalance
|
|
126
|
-
val saplingBalances = map.saplingBalances
|
|
127
|
-
val orchardBalances = map.orchardBalances
|
|
153
|
+
wallet.walletBalances.collectWith(scope) { balancesMap ->
|
|
154
|
+
val accountBalance = balancesMap?.values?.firstOrNull()
|
|
155
|
+
val transparentBalance = accountBalance?.unshielded
|
|
156
|
+
val saplingBalances = accountBalance?.sapling
|
|
157
|
+
val orchardBalances = accountBalance?.orchard
|
|
128
158
|
|
|
129
159
|
val transparentAvailableZatoshi = transparentBalance ?: Zatoshi(0L)
|
|
130
160
|
val transparentTotalZatoshi = transparentBalance ?: Zatoshi(0L)
|
|
@@ -188,11 +218,15 @@ class RNZcashModule(
|
|
|
188
218
|
alias: String,
|
|
189
219
|
promise: Promise,
|
|
190
220
|
) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
221
|
+
val wallet = getWallet(alias)
|
|
222
|
+
moduleScope.launch {
|
|
223
|
+
try {
|
|
224
|
+
wallet.closeFlow().first()
|
|
225
|
+
synchronizerMap.remove(alias)
|
|
226
|
+
promise.resolve(null)
|
|
227
|
+
} catch (t: Throwable) {
|
|
228
|
+
promise.reject("Err", t)
|
|
229
|
+
}
|
|
196
230
|
}
|
|
197
231
|
}
|
|
198
232
|
|
|
@@ -204,19 +238,20 @@ class RNZcashModule(
|
|
|
204
238
|
val job =
|
|
205
239
|
wallet.coroutineScope.launch {
|
|
206
240
|
map.putString("value", tx.netValue.value.toString())
|
|
207
|
-
|
|
208
|
-
map.putString("fee", tx.feePaid!!.value.toString())
|
|
209
|
-
}
|
|
241
|
+
tx.feePaid?.let { fee -> map.putString("fee", fee.value.toString()) }
|
|
210
242
|
map.putInt("minedHeight", tx.minedHeight?.value?.toInt() ?: 0)
|
|
211
243
|
map.putInt("blockTimeInSeconds", tx.blockTimeEpochSeconds?.toInt() ?: 0)
|
|
212
|
-
map.putString("rawTransactionId", tx.txIdString())
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
244
|
+
map.putString("rawTransactionId", tx.txId.txIdString())
|
|
245
|
+
map.putBoolean("isShielding", tx.isShielding)
|
|
246
|
+
map.putBoolean("isExpired", tx.transactionState == TransactionState.Expired)
|
|
247
|
+
tx.raw
|
|
248
|
+
?.byteArray
|
|
249
|
+
?.toHex()
|
|
250
|
+
?.let { hex -> map.putString("raw", hex) }
|
|
216
251
|
if (tx.isSentTransaction) {
|
|
217
252
|
try {
|
|
218
253
|
val recipient = wallet.getRecipients(tx).first()
|
|
219
|
-
if (recipient
|
|
254
|
+
if (recipient.addressValue != null) {
|
|
220
255
|
map.putString("toAddress", recipient.addressValue)
|
|
221
256
|
}
|
|
222
257
|
} catch (t: Throwable) {
|
|
@@ -240,11 +275,15 @@ class RNZcashModule(
|
|
|
240
275
|
promise: Promise,
|
|
241
276
|
) {
|
|
242
277
|
val wallet = getWallet(alias)
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
278
|
+
moduleScope.launch {
|
|
279
|
+
// Clear emitted transactions tracking and starting block height for this alias
|
|
280
|
+
emittedTransactions[alias]?.clear()
|
|
281
|
+
|
|
282
|
+
wallet.coroutineScope
|
|
283
|
+
.async {
|
|
284
|
+
wallet.rewindToNearestHeight(wallet.latestBirthdayHeight)
|
|
285
|
+
}.await()
|
|
286
|
+
promise.resolve(null)
|
|
248
287
|
}
|
|
249
288
|
}
|
|
250
289
|
|
|
@@ -303,6 +342,10 @@ class RNZcashModule(
|
|
|
303
342
|
response.toThrowable(),
|
|
304
343
|
)
|
|
305
344
|
}
|
|
345
|
+
|
|
346
|
+
else -> {
|
|
347
|
+
throw Exception("Unknown response type")
|
|
348
|
+
}
|
|
306
349
|
}
|
|
307
350
|
}
|
|
308
351
|
}
|
|
@@ -319,9 +362,10 @@ class RNZcashModule(
|
|
|
319
362
|
val wallet = getWallet(alias)
|
|
320
363
|
wallet.coroutineScope.launch {
|
|
321
364
|
try {
|
|
365
|
+
val account = wallet.getAccounts().first()
|
|
322
366
|
val proposal =
|
|
323
367
|
wallet.proposeTransfer(
|
|
324
|
-
|
|
368
|
+
account,
|
|
325
369
|
toAddress,
|
|
326
370
|
Zatoshi(zatoshi.toLong()),
|
|
327
371
|
memo,
|
|
@@ -349,7 +393,12 @@ class RNZcashModule(
|
|
|
349
393
|
wallet.coroutineScope.launch {
|
|
350
394
|
try {
|
|
351
395
|
val seedPhrase = SeedPhrase.new(seed)
|
|
352
|
-
val usk =
|
|
396
|
+
val usk =
|
|
397
|
+
DerivationTool.getInstance().deriveUnifiedSpendingKey(
|
|
398
|
+
seedPhrase.toByteArray(),
|
|
399
|
+
wallet.network,
|
|
400
|
+
Zip32AccountIndex.new(0),
|
|
401
|
+
)
|
|
353
402
|
val proposalByteArray = Base64.getDecoder().decode(proposalBase64)
|
|
354
403
|
val proposal = Proposal.fromByteArray(proposalByteArray)
|
|
355
404
|
|
|
@@ -377,21 +426,32 @@ class RNZcashModule(
|
|
|
377
426
|
val wallet = getWallet(alias)
|
|
378
427
|
wallet.coroutineScope.launch {
|
|
379
428
|
try {
|
|
429
|
+
val account = wallet.getAccounts().first()
|
|
430
|
+
val proposal = wallet.proposeShielding(account, Zatoshi(threshold.toLong()), memo, null)
|
|
431
|
+
if (proposal == null) {
|
|
432
|
+
promise.reject("Err", Exception("Failed to propose shielding transaction"))
|
|
433
|
+
return@launch
|
|
434
|
+
}
|
|
380
435
|
val seedPhrase = SeedPhrase.new(seed)
|
|
381
|
-
val usk =
|
|
382
|
-
|
|
383
|
-
|
|
436
|
+
val usk =
|
|
437
|
+
DerivationTool.getInstance().deriveUnifiedSpendingKey(
|
|
438
|
+
seedPhrase.toByteArray(),
|
|
439
|
+
wallet.network,
|
|
440
|
+
Zip32AccountIndex.new(0),
|
|
441
|
+
)
|
|
442
|
+
val result =
|
|
443
|
+
wallet.createProposedTransactions(
|
|
444
|
+
proposal,
|
|
384
445
|
usk,
|
|
385
|
-
memo,
|
|
386
446
|
)
|
|
387
|
-
val
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
447
|
+
val shieldingTx = result.first()
|
|
448
|
+
|
|
449
|
+
if (shieldingTx is TransactionSubmitResult.Success) {
|
|
450
|
+
val shieldingTxid = shieldingTx.txIdString()
|
|
451
|
+
promise.resolve(shieldingTxid)
|
|
452
|
+
} else {
|
|
453
|
+
promise.reject("Err", Exception("Failed to create shielding transaction"))
|
|
454
|
+
}
|
|
395
455
|
} catch (t: Throwable) {
|
|
396
456
|
promise.reject("Err", t)
|
|
397
457
|
}
|
|
@@ -409,16 +469,19 @@ class RNZcashModule(
|
|
|
409
469
|
) {
|
|
410
470
|
val wallet = getWallet(alias)
|
|
411
471
|
wallet.coroutineScope.launch {
|
|
412
|
-
|
|
413
|
-
val
|
|
414
|
-
val
|
|
415
|
-
val
|
|
472
|
+
try {
|
|
473
|
+
val account = wallet.getAccounts().first()
|
|
474
|
+
val unifiedAddress = wallet.getUnifiedAddress(account)
|
|
475
|
+
val saplingAddress = wallet.getSaplingAddress(account)
|
|
476
|
+
val transparentAddress = wallet.getTransparentAddress(account)
|
|
416
477
|
|
|
417
478
|
val map = Arguments.createMap()
|
|
418
479
|
map.putString("unifiedAddress", unifiedAddress)
|
|
419
480
|
map.putString("saplingAddress", saplingAddress)
|
|
420
481
|
map.putString("transparentAddress", transparentAddress)
|
|
421
|
-
|
|
482
|
+
promise.resolve(map)
|
|
483
|
+
} catch (t: Throwable) {
|
|
484
|
+
promise.reject("Err", t)
|
|
422
485
|
}
|
|
423
486
|
}
|
|
424
487
|
}
|
|
@@ -474,10 +537,4 @@ class RNZcashModule(
|
|
|
474
537
|
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
475
538
|
.emit(eventName, args)
|
|
476
539
|
}
|
|
477
|
-
|
|
478
|
-
data class Balances(
|
|
479
|
-
val transparentBalance: Zatoshi?,
|
|
480
|
-
val saplingBalances: WalletBalance?,
|
|
481
|
-
val orchardBalances: WalletBalance?,
|
|
482
|
-
)
|
|
483
540
|
}
|
package/ios/RNZcash.m
CHANGED
|
@@ -15,11 +15,6 @@ resolver:(RCTPromiseResolveBlock)resolve
|
|
|
15
15
|
rejecter:(RCTPromiseRejectBlock)reject
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
-
RCT_EXTERN_METHOD(start:(NSString *)alias
|
|
19
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
20
|
-
rejecter:(RCTPromiseRejectBlock)reject
|
|
21
|
-
)
|
|
22
|
-
|
|
23
18
|
RCT_EXTERN_METHOD(stop:(NSString *)alias
|
|
24
19
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
25
20
|
rejecter:(RCTPromiseRejectBlock)reject
|