react-native-zcash 0.6.14 → 0.7.1
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 +12 -0
- package/README.md +1 -0
- package/android/build.gradle +4 -4
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2470000.json +8 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2480000.json +8 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2490000.json +8 -0
- package/android/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet/2500000.json +8 -0
- package/android/src/main/java/app/edge/rnzcash/RNZcashModule.kt +51 -9
- package/ios/RNZcash.m +8 -0
- package/ios/RNZcash.swift +66 -16
- package/ios/ZCashLightClientKit/Block/Actions/DownloadAction.swift +1 -1
- package/ios/ZCashLightClientKit/Block/Actions/EnhanceAction.swift +3 -1
- package/ios/ZCashLightClientKit/Block/Actions/FetchUTXOsAction.swift +1 -1
- package/ios/ZCashLightClientKit/Block/Actions/ProcessSuggestedScanRangesAction.swift +11 -2
- package/ios/ZCashLightClientKit/Block/Actions/RewindAction.swift +2 -2
- package/ios/ZCashLightClientKit/Block/Actions/ScanAction.swift +28 -11
- package/ios/ZCashLightClientKit/Block/Actions/UpdateChainTipAction.swift +4 -4
- package/ios/ZCashLightClientKit/Block/Actions/UpdateSubtreeRootsAction.swift +36 -7
- package/ios/ZCashLightClientKit/Block/Actions/ValidateServerAction.swift +1 -1
- package/ios/ZCashLightClientKit/Block/CompactBlockProcessor.swift +93 -51
- package/ios/ZCashLightClientKit/Block/Download/BlockDownloader.swift +0 -26
- package/ios/ZCashLightClientKit/Block/Enhance/BlockEnhancer.swift +5 -6
- package/ios/ZCashLightClientKit/Block/FetchUnspentTxOutputs/UTXOFetcher.swift +1 -11
- package/ios/ZCashLightClientKit/Block/SaplingParameters/SaplingParametersHandler.swift +6 -4
- package/ios/ZCashLightClientKit/Block/Scan/BlockScanner.swift +10 -12
- package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointSource.swift +38 -0
- package/ios/ZCashLightClientKit/Checkpoint/BundleCheckpointURLProvider.swift +40 -0
- package/ios/ZCashLightClientKit/{Constants/Checkpoint+Constants.swift → Checkpoint/Checkpoint+helpers.swift} +1 -33
- package/ios/ZCashLightClientKit/Checkpoint/CheckpointSource.swift +34 -0
- package/ios/ZCashLightClientKit/Checkpoint/CheckpointSourceFactory.swift +14 -0
- package/ios/ZCashLightClientKit/ClosureSynchronizer.swift +61 -6
- package/ios/ZCashLightClientKit/CombineSynchronizer.swift +63 -4
- package/ios/ZCashLightClientKit/Constants/ZcashSDK.swift +4 -0
- package/ios/ZCashLightClientKit/DAO/TransactionDao.swift +21 -33
- package/ios/ZCashLightClientKit/DAO/UnspentTransactionOutputDao.swift +0 -182
- package/ios/ZCashLightClientKit/Entity/AccountEntity.swift +0 -173
- package/ios/ZCashLightClientKit/Entity/TransactionEntity.swift +5 -2
- package/ios/ZCashLightClientKit/Error/Sourcery/generateErrorCode.sh +1 -1
- package/ios/ZCashLightClientKit/Error/ZcashError.swift +53 -1
- package/ios/ZCashLightClientKit/Error/ZcashErrorCode.swift +19 -1
- package/ios/ZCashLightClientKit/Error/ZcashErrorCodeDefinition.swift +32 -0
- package/ios/ZCashLightClientKit/Initializer.swift +8 -17
- package/ios/ZCashLightClientKit/Metrics/SDKMetrics.swift +103 -217
- package/ios/ZCashLightClientKit/Model/Proposal.swift +45 -0
- package/ios/ZCashLightClientKit/Model/ScanSummary.swift +14 -0
- package/ios/ZCashLightClientKit/Model/WalletSummary.swift +58 -0
- package/ios/ZCashLightClientKit/Model/WalletTypes.swift +0 -16
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/LightWalletGRPCService.swift +5 -3
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proposal.pb.swift +934 -0
- package/ios/ZCashLightClientKit/Modules/Service/GRPC/ProtoBuf/proto/proposal.proto +138 -0
- package/ios/ZCashLightClientKit/Modules/Service/LightWalletService.swift +2 -4
- package/ios/ZCashLightClientKit/Providers/LatestBlocksDataProvider.swift +9 -1
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2272500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2275000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2277500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2282500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2285000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2287500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2292500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2295000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2297500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2302500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2305000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2307500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2312500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2315000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2317500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2322500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2325000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2327500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2332500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2335000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2337500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2342500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2345000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2347500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2352500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2355000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2357500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2362500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2365000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2367500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2372500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2375000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2377500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2382500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2385000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2387500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2392500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2395000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2397500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2402500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2405000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2407500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2412500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2415000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2417500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2422500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2425000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2427500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2432500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2435000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2437500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2442500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2445000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2447500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2452500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2455000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2457500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2462500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2465000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2467500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2470000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2472500.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2480000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2490000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/mainnet/2500000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2560000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2570000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2580000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2590000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2600000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2610000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2620000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2630000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2640000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2650000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2660000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2670000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2680000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2690000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2700000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2710000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2720000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2730000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2740000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2750000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2760000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2770000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2780000.json +8 -0
- package/ios/ZCashLightClientKit/Resources/checkpoints/testnet/2790000.json +8 -0
- package/ios/ZCashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +1 -5
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackend.swift +327 -153
- package/ios/ZCashLightClientKit/Rust/ZcashRustBackendWelding.swift +78 -36
- package/ios/ZCashLightClientKit/Rust/zcashlc.h +402 -118
- package/ios/ZCashLightClientKit/Synchronizer/ClosureSDKSynchronizer.swift +43 -14
- package/ios/ZCashLightClientKit/Synchronizer/CombineSDKSynchronizer.swift +52 -14
- package/ios/ZCashLightClientKit/Synchronizer/Dependencies.swift +10 -6
- package/ios/ZCashLightClientKit/Synchronizer/SDKSynchronizer.swift +220 -70
- package/ios/ZCashLightClientKit/Synchronizer.swift +105 -29
- package/ios/ZCashLightClientKit/Transaction/TransactionEncoder.swift +61 -32
- package/ios/ZCashLightClientKit/Transaction/WalletTransactionEncoder.swift +52 -61
- package/ios/ZCashLightClientKit/Utils/DBActor.swift +21 -0
- package/ios/ZCashLightClientKit/Utils/LoggingProxy.swift +5 -0
- package/ios/ZCashLightClientKit/Utils/OSLogger.swift +71 -14
- package/ios/libzcashlc.xcframework/ios-arm64/libzcashlc.a +0 -0
- package/ios/libzcashlc.xcframework/ios-arm64_x86_64-simulator/libzcashlc.a +0 -0
- package/lib/rnzcash.rn.js +21 -6
- package/lib/rnzcash.rn.js.map +1 -1
- package/lib/src/react-native.d.ts +2 -1
- package/lib/src/types.d.ts +9 -1
- package/package.json +1 -1
- package/react-native-zcash.podspec +1 -1
- package/src/react-native.ts +23 -4
- package/src/types.ts +10 -1
- package/ios/ZCashLightClientKit/Model/ScanProgress.swift +0 -29
- package/ios/ZCashLightClientKit/Repository/UnspentTransactionOutputRepository.swift +0 -16
- /package/ios/ZCashLightClientKit/{Model → Checkpoint}/Checkpoint.swift +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// ZcashRustBackendWelding.swift
|
|
3
3
|
// ZcashLightClientKit
|
|
4
4
|
//
|
|
5
|
-
// Created by Francisco Gindre on 12
|
|
5
|
+
// Created by Francisco 'Pacu' Gindre on 2019-12-09.
|
|
6
6
|
// Copyright © 2019 Electric Coin Company. All rights reserved.
|
|
7
7
|
//
|
|
8
8
|
|
|
@@ -11,15 +11,20 @@ import Foundation
|
|
|
11
11
|
enum ZcashRustBackendWeldingConstants {
|
|
12
12
|
static let validChain: Int32 = -1
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
///
|
|
14
|
+
|
|
15
|
+
/// Enumeration of potential return states for database initialization.
|
|
16
|
+
///
|
|
17
|
+
/// If `seedRequired` is returned, the caller must re-attempt initialization providing the seed.
|
|
16
18
|
public enum DbInitResult {
|
|
17
19
|
case success
|
|
18
20
|
case seedRequired
|
|
21
|
+
case seedNotRelevant
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
// sourcery: mockActor
|
|
22
24
|
protocol ZcashRustBackendWelding {
|
|
25
|
+
/// Returns a list of the accounts in the wallet.
|
|
26
|
+
func listAccounts() async throws -> [Int32]
|
|
27
|
+
|
|
23
28
|
/// Adds the next available account-level spend authority, given the current set of [ZIP 316]
|
|
24
29
|
/// account identifiers known, to the wallet database.
|
|
25
30
|
///
|
|
@@ -41,18 +46,10 @@ protocol ZcashRustBackendWelding {
|
|
|
41
46
|
/// - Throws: `rustCreateAccount`.
|
|
42
47
|
func createAccount(seed: [UInt8], treeState: TreeState, recoverUntil: UInt32?) async throws -> UnifiedSpendingKey
|
|
43
48
|
|
|
44
|
-
///
|
|
45
|
-
///
|
|
46
|
-
/// -
|
|
47
|
-
|
|
48
|
-
/// - Parameter memo: the `MemoBytes` for this transaction. pass `nil` when sending to transparent receivers
|
|
49
|
-
/// - Throws: `rustCreateToAddress`.
|
|
50
|
-
func createToAddress(
|
|
51
|
-
usk: UnifiedSpendingKey,
|
|
52
|
-
to address: String,
|
|
53
|
-
value: Int64,
|
|
54
|
-
memo: MemoBytes?
|
|
55
|
-
) async throws -> Data
|
|
49
|
+
/// Checks whether the given seed is relevant to any of the derived accounts in the wallet.
|
|
50
|
+
///
|
|
51
|
+
/// - parameter seed: byte array of the seed
|
|
52
|
+
func isSeedRelevantToAnyDerivedAccount(seed: [UInt8]) async throws -> Bool
|
|
56
53
|
|
|
57
54
|
/// Scans a transaction for any information that can be decrypted by the accounts in the wallet, and saves it to the wallet.
|
|
58
55
|
/// - parameter tx: the transaction to decrypt
|
|
@@ -60,11 +57,6 @@ protocol ZcashRustBackendWelding {
|
|
|
60
57
|
/// - Throws: `rustDecryptAndStoreTransaction`.
|
|
61
58
|
func decryptAndStoreTransaction(txBytes: [UInt8], minedHeight: Int32) async throws
|
|
62
59
|
|
|
63
|
-
/// Get the (unverified) balance from the given account.
|
|
64
|
-
/// - parameter account: index of the given account
|
|
65
|
-
/// - Throws: `rustGetBalance`.
|
|
66
|
-
func getBalance(account: Int32) async throws -> Int64
|
|
67
|
-
|
|
68
60
|
/// Returns the most-recently-generated unified payment address for the specified account.
|
|
69
61
|
/// - parameter account: index of the given account
|
|
70
62
|
/// - Throws:
|
|
@@ -93,8 +85,9 @@ protocol ZcashRustBackendWelding {
|
|
|
93
85
|
|
|
94
86
|
/// Get memo from note.
|
|
95
87
|
/// - parameter txId: ID of transaction containing the note
|
|
88
|
+
/// - parameter outputPool: output pool identifier (2 = Sapling, 3 = Orchard)
|
|
96
89
|
/// - parameter outputIndex: output index of note
|
|
97
|
-
func getMemo(txId: Data, outputIndex: UInt16) async throws -> Memo?
|
|
90
|
+
func getMemo(txId: Data, outputPool: UInt32, outputIndex: UInt16) async throws -> Memo?
|
|
98
91
|
|
|
99
92
|
/// Get the verified cached transparent balance for the given address
|
|
100
93
|
/// - parameter account; the account index to query
|
|
@@ -120,11 +113,6 @@ protocol ZcashRustBackendWelding {
|
|
|
120
113
|
/// - `rustListTransparentReceiversInvalidAddress` if transarent received generated by rust is invalid.
|
|
121
114
|
func listTransparentReceivers(account: Int32) async throws -> [TransparentAddress]
|
|
122
115
|
|
|
123
|
-
/// Get the verified balance from the given account
|
|
124
|
-
/// - parameter account: index of the given account
|
|
125
|
-
/// - Throws: `rustGetVerifiedBalance` when rust layer throws error.
|
|
126
|
-
func getVerifiedBalance(account: Int32) async throws -> Int64
|
|
127
|
-
|
|
128
116
|
/// Get the verified cached transparent balance for the given account
|
|
129
117
|
/// - parameter account: account index to query the balance for.
|
|
130
118
|
/// - Throws:
|
|
@@ -145,6 +133,8 @@ protocol ZcashRustBackendWelding {
|
|
|
145
133
|
|
|
146
134
|
func putSaplingSubtreeRoots(startIndex: UInt64, roots: [SubtreeRoot]) async throws
|
|
147
135
|
|
|
136
|
+
func putOrchardSubtreeRoots(startIndex: UInt64, roots: [SubtreeRoot]) async throws
|
|
137
|
+
|
|
148
138
|
/// Updates the wallet's view of the blockchain.
|
|
149
139
|
///
|
|
150
140
|
/// This method is used to provide the wallet with information about the state of the blockchain,
|
|
@@ -167,8 +157,8 @@ protocol ZcashRustBackendWelding {
|
|
|
167
157
|
/// height due to the fact that out-of-order scanning can leave gaps.
|
|
168
158
|
func maxScannedHeight() async throws -> BlockHeight?
|
|
169
159
|
|
|
170
|
-
/// Returns the
|
|
171
|
-
func
|
|
160
|
+
/// Returns the account balances and sync status of the wallet.
|
|
161
|
+
func getWalletSummary() async throws -> WalletSummary?
|
|
172
162
|
|
|
173
163
|
/// Returns a list of suggested scan ranges based upon the current wallet state.
|
|
174
164
|
///
|
|
@@ -196,9 +186,10 @@ protocol ZcashRustBackendWelding {
|
|
|
196
186
|
/// cache, an error will be signalled.
|
|
197
187
|
///
|
|
198
188
|
/// - parameter fromHeight: scan starting from the given height.
|
|
189
|
+
/// - parameter fromState: The TreeState Protobuf object for the height prior to `fromHeight`
|
|
199
190
|
/// - parameter limit: scan up to limit blocks.
|
|
200
191
|
/// - Throws: `rustScanBlocks` if rust layer returns error.
|
|
201
|
-
func scanBlocks(fromHeight: Int32, limit: UInt32) async throws
|
|
192
|
+
func scanBlocks(fromHeight: Int32, fromState: TreeState, limit: UInt32) async throws -> ScanSummary
|
|
202
193
|
|
|
203
194
|
/// Upserts a UTXO into the data db database
|
|
204
195
|
/// - parameter txid: the txid bytes for the UTXO
|
|
@@ -215,15 +206,66 @@ protocol ZcashRustBackendWelding {
|
|
|
215
206
|
height: BlockHeight
|
|
216
207
|
) async throws
|
|
217
208
|
|
|
218
|
-
///
|
|
219
|
-
///
|
|
209
|
+
/// Select transaction inputs, compute fees, and construct a proposal for a transaction
|
|
210
|
+
/// that can then be authorized and made ready for submission to the network with
|
|
211
|
+
/// `createProposedTransaction`.
|
|
212
|
+
///
|
|
213
|
+
/// - parameter account: index of the given account
|
|
214
|
+
/// - Parameter to: recipient address
|
|
215
|
+
/// - Parameter value: transaction amount in Zatoshi
|
|
216
|
+
/// - Parameter memo: the `MemoBytes` for this transaction. pass `nil` when sending to transparent receivers
|
|
217
|
+
/// - Throws: `rustCreateToAddress`.
|
|
218
|
+
func proposeTransfer(
|
|
219
|
+
account: Int32,
|
|
220
|
+
to address: String,
|
|
221
|
+
value: Int64,
|
|
222
|
+
memo: MemoBytes?
|
|
223
|
+
) async throws -> FfiProposal
|
|
224
|
+
|
|
225
|
+
/// Select transaction inputs, compute fees, and construct a proposal for a transaction
|
|
226
|
+
/// that can then be authorized and made ready for submission to the network with
|
|
227
|
+
/// `createProposedTransaction` from a valid [ZIP-321](https://zips.z.cash/zip-0321) Payment Request UR
|
|
228
|
+
///
|
|
229
|
+
/// - parameter uri: the URI String that the proposal will be made from.
|
|
230
|
+
/// - parameter account: index of the given account
|
|
231
|
+
/// - Parameter to: recipient address
|
|
232
|
+
/// - Parameter value: transaction amount in Zatoshi
|
|
233
|
+
/// - Parameter memo: the `MemoBytes` for this transaction. pass `nil` when sending to transparent receivers
|
|
234
|
+
/// - Throws: `rustCreateToAddress`.
|
|
235
|
+
func proposeTransferFromURI(
|
|
236
|
+
_ uri: String,
|
|
237
|
+
account: Int32
|
|
238
|
+
) async throws -> FfiProposal
|
|
239
|
+
|
|
240
|
+
/// Constructs a transaction proposal to shield all found UTXOs in data db for the given account,
|
|
241
|
+
/// that can then be authorized and made ready for submission to the network with
|
|
242
|
+
/// `createProposedTransaction`.
|
|
243
|
+
///
|
|
244
|
+
/// Returns the proposal, or `nil` if the transparent balance that would be shielded
|
|
245
|
+
/// is zero or below `shieldingThreshold`.
|
|
246
|
+
///
|
|
247
|
+
/// - parameter account: index of the given account
|
|
220
248
|
/// - Parameter memo: the `Memo` for this transaction
|
|
249
|
+
/// - Parameter transparentReceiver: a specific transparent receiver within the account
|
|
250
|
+
/// that should be the source of transparent funds. Default is `nil` which
|
|
251
|
+
/// will select whichever of the account's transparent receivers has funds
|
|
252
|
+
/// to shield.
|
|
221
253
|
/// - Throws: `rustShieldFunds` if rust layer returns error.
|
|
222
|
-
func
|
|
223
|
-
|
|
254
|
+
func proposeShielding(
|
|
255
|
+
account: Int32,
|
|
224
256
|
memo: MemoBytes?,
|
|
225
|
-
shieldingThreshold: Zatoshi
|
|
226
|
-
|
|
257
|
+
shieldingThreshold: Zatoshi,
|
|
258
|
+
transparentReceiver: String?
|
|
259
|
+
) async throws -> FfiProposal?
|
|
260
|
+
|
|
261
|
+
/// Creates a transaction from the given proposal.
|
|
262
|
+
/// - Parameter proposal: the transaction proposal.
|
|
263
|
+
/// - Parameter usk: `UnifiedSpendingKey` for the account that controls the funds to be spent.
|
|
264
|
+
/// - Throws: `rustCreateToAddress`.
|
|
265
|
+
func createProposedTransactions(
|
|
266
|
+
proposal: FfiProposal,
|
|
267
|
+
usk: UnifiedSpendingKey
|
|
268
|
+
) async throws -> [Data]
|
|
227
269
|
|
|
228
270
|
/// Gets the consensus branch id for the given height
|
|
229
271
|
/// - Parameter height: the height you what to know the branch id for
|