-
public interface BackendContract defining the exposed capabilities of the Rust backend. This is what welds the SDK to the Rust layer. It is not documented because it is not intended to be used, directly. Instead, use the synchronizer or one of its subcomponents.
-
-
Method Summary
Modifier and Type Method Description abstract IntegerinitBlockMetaDb()abstract ProposalUnsafeproposeTransfer(ByteArray accountUuid, String to, Long value, ByteArray memo)abstract ProposalUnsafeproposeTransferFromUri(ByteArray accountUuid, String uri)abstract ProposalUnsafeproposeShielding(ByteArray accountUuid, Long shieldingThreshold, ByteArray memo, String transparentReceiver)abstract List<ByteArray>createProposedTransactions(ProposalUnsafe proposal, ByteArray unifiedSpendingKey)abstract ByteArraycreatePcztFromProposal(ByteArray accountUuid, ProposalUnsafe proposal)Creates a partially-created (unsigned without proofs) transaction from the given proposal. abstract ByteArrayredactPcztForSigner(ByteArray pczt)Redacts information from the given PCZT that is unnecessary for the Signer role. abstract BooleanpcztRequiresSaplingProofs(ByteArray pczt)Checks whether the caller needs to have downloaded the Sapling parameters. abstract ByteArrayaddProofsToPczt(ByteArray pczt)Adds proofs to the given PCZT. abstract ByteArrayextractAndStoreTxFromPczt(ByteArray pcztWithProofs, ByteArray pcztWithSignatures)Takes a PCZT that has been separately proven and signed, finalizes it, and stores it in the wallet. abstract ByteArraydecryptAndStoreTransaction(ByteArray tx, Long minedHeight)abstract IntegerinitDataDb(ByteArray seed)Sets up the internal structure of the data database. abstract List<JniAccount>getAccounts()abstract JniAccountgetAccountForUfvk(String ufvk)abstract JniAccountUskcreateAccount(String accountName, String keySource, ByteArray seed, ByteArray treeState, Long recoverUntil)abstract JniAccountimportAccountUfvk(String accountName, String keySource, String ufvk, ByteArray treeState, Long recoverUntil, Integer purpose, ByteArray seedFingerprint, Long zip32AccountIndex)abstract BooleanisSeedRelevantToAnyDerivedAccounts(ByteArray seed)abstract BooleanisValidSaplingAddr(String addr)abstract BooleanisValidTransparentAddr(String addr)abstract BooleanisValidUnifiedAddr(String addr)abstract BooleanisValidTexAddr(String addr)abstract StringgetCurrentAddress(ByteArray accountUuid)abstract JniSingleUseTransparentAddressgetSingleUseTransparentAddress(ByteArray accountUuid)abstract StringgetNextAvailableAddress(ByteArray accountUuid, Integer receiverFlags)abstract StringgetTransparentReceiver(String ua)abstract StringgetSaplingReceiver(String ua)abstract List<String>listTransparentReceivers(ByteArray accountUuid)abstract LonggetBranchIdForHeight(Long height)abstract StringgetMemoAsUtf8(ByteArray txId, Integer protocol, Integer outputIndex)abstract JniRewindResultrewindToHeight(Long height)abstract UnitputSubtreeRoots(Long saplingStartIndex, List<JniSubtreeRoot> saplingRoots, Long orchardStartIndex, List<JniSubtreeRoot> orchardRoots)abstract UnitupdateChainTip(Long height)abstract LonggetFullyScannedHeight()Returns the height to which the wallet has been fully scanned. abstract LonggetMaxScannedHeight()Returns the maximum height that the wallet has scanned. abstract JniWalletSummarygetWalletSummary()abstract List<JniScanRange>suggestScanRanges()abstract JniScanSummaryscanBlocks(Long fromHeight, ByteArray fromState, Long limit)abstract List<JniTransactionDataRequest>transactionDataRequests()abstract UnitfixWitnesses()This function calls check_witnessesandqueue_rescansfrom the underlying librustzcash internally.abstract UnitwriteBlockMetadata(List<JniBlockMeta> blockMetadata)abstract LonggetLatestCacheHeight()abstract JniBlockMetafindBlockMetadata(Long height)abstract UnitrewindBlockMetadataToHeight(Long height)abstract LonggetTotalTransparentBalance(String address)abstract UnitputUtxo(ByteArray txId, Integer index, ByteArray script, Long value, Long height)abstract UnitsetTransactionStatus(ByteArray txId, Long status)<T extends Any> <ERROR CLASS>withWallet(SuspendFunction2<File, Integer, T> block)abstract IntegergetNetworkId()abstract FilegetDataDbFile()-
-
Method Detail
-
initBlockMetaDb
abstract Integer initBlockMetaDb()
-
proposeTransfer
abstract ProposalUnsafe proposeTransfer(ByteArray accountUuid, String to, Long value, ByteArray memo)
-
proposeTransferFromUri
abstract ProposalUnsafe proposeTransferFromUri(ByteArray accountUuid, String uri)
-
proposeShielding
abstract ProposalUnsafe proposeShielding(ByteArray accountUuid, Long shieldingThreshold, ByteArray memo, String transparentReceiver)
-
createProposedTransactions
abstract List<ByteArray> createProposedTransactions(ProposalUnsafe proposal, ByteArray unifiedSpendingKey)
-
createPcztFromProposal
abstract ByteArray createPcztFromProposal(ByteArray accountUuid, ProposalUnsafe proposal)
Creates a partially-created (unsigned without proofs) transaction from the given proposal.
Do not call this multiple times in parallel, or you will generate PCZT instances that, if finalized, would double-spend the same notes.
-
redactPcztForSigner
abstract ByteArray redactPcztForSigner(ByteArray pczt)
Redacts information from the given PCZT that is unnecessary for the Signer role.
-
pcztRequiresSaplingProofs
abstract Boolean pcztRequiresSaplingProofs(ByteArray pczt)
Checks whether the caller needs to have downloaded the Sapling parameters.
-
addProofsToPczt
abstract ByteArray addProofsToPczt(ByteArray pczt)
Adds proofs to the given PCZT.
-
extractAndStoreTxFromPczt
abstract ByteArray extractAndStoreTxFromPczt(ByteArray pcztWithProofs, ByteArray pcztWithSignatures)
Takes a PCZT that has been separately proven and signed, finalizes it, and stores it in the wallet.
-
decryptAndStoreTransaction
abstract ByteArray decryptAndStoreTransaction(ByteArray tx, Long minedHeight)
-
initDataDb
abstract Integer initDataDb(ByteArray seed)
Sets up the internal structure of the data database.
If
seedisnull, database migrations will be attempted without it.
-
getAccounts
abstract List<JniAccount> getAccounts()
-
getAccountForUfvk
abstract JniAccount getAccountForUfvk(String ufvk)
-
createAccount
abstract JniAccountUsk createAccount(String accountName, String keySource, ByteArray seed, ByteArray treeState, Long recoverUntil)
-
importAccountUfvk
abstract JniAccount importAccountUfvk(String accountName, String keySource, String ufvk, ByteArray treeState, Long recoverUntil, Integer purpose, ByteArray seedFingerprint, Long zip32AccountIndex)
-
isSeedRelevantToAnyDerivedAccounts
abstract Boolean isSeedRelevantToAnyDerivedAccounts(ByteArray seed)
-
isValidSaplingAddr
abstract Boolean isValidSaplingAddr(String addr)
-
isValidTransparentAddr
abstract Boolean isValidTransparentAddr(String addr)
-
isValidUnifiedAddr
abstract Boolean isValidUnifiedAddr(String addr)
-
isValidTexAddr
abstract Boolean isValidTexAddr(String addr)
-
getCurrentAddress
abstract String getCurrentAddress(ByteArray accountUuid)
-
getSingleUseTransparentAddress
abstract JniSingleUseTransparentAddress getSingleUseTransparentAddress(ByteArray accountUuid)
-
getNextAvailableAddress
abstract String getNextAvailableAddress(ByteArray accountUuid, Integer receiverFlags)
-
getTransparentReceiver
abstract String getTransparentReceiver(String ua)
-
getSaplingReceiver
abstract String getSaplingReceiver(String ua)
-
listTransparentReceivers
abstract List<String> listTransparentReceivers(ByteArray accountUuid)
-
getBranchIdForHeight
abstract Long getBranchIdForHeight(Long height)
-
getMemoAsUtf8
abstract String getMemoAsUtf8(ByteArray txId, Integer protocol, Integer outputIndex)
-
rewindToHeight
abstract JniRewindResult rewindToHeight(Long height)
-
putSubtreeRoots
abstract Unit putSubtreeRoots(Long saplingStartIndex, List<JniSubtreeRoot> saplingRoots, Long orchardStartIndex, List<JniSubtreeRoot> orchardRoots)
-
updateChainTip
abstract Unit updateChainTip(Long height)
-
getFullyScannedHeight
abstract Long getFullyScannedHeight()
Returns the height to which the wallet has been fully scanned.
This is the height for which the wallet has fully trial-decrypted this and all preceding blocks above the wallet's birthday height.
-
getMaxScannedHeight
abstract Long getMaxScannedHeight()
Returns the maximum height that the wallet has scanned.
If the wallet is fully synced, this will be equivalent to
getFullyScannedHeight; otherwise the maximal scanned height is likely to be greater than the fully scanned height due to the fact that out-of-order scanning can leave gaps.
-
getWalletSummary
abstract JniWalletSummary getWalletSummary()
-
suggestScanRanges
abstract List<JniScanRange> suggestScanRanges()
-
scanBlocks
abstract JniScanSummary scanBlocks(Long fromHeight, ByteArray fromState, Long limit)
-
transactionDataRequests
abstract List<JniTransactionDataRequest> transactionDataRequests()
-
fixWitnesses
abstract Unit fixWitnesses()
This function calls
check_witnessesandqueue_rescansfrom the underlying librustzcash internally. This method is intended for repairing wallets that broke due to bugs inshardtree.check_witnesses: It attempts to construct a witness for each note belonging to the wallet that is believed by the wallet to currently be spendable, and returns a vector of the ranges that must be rescanned in order to correct missing witness data.queue_rescans: Updates the scan queue by inserting scan ranges for the given range of block heights, with the specified scanning priority.
-
writeBlockMetadata
abstract Unit writeBlockMetadata(List<JniBlockMeta> blockMetadata)
-
getLatestCacheHeight
abstract Long getLatestCacheHeight()
-
findBlockMetadata
abstract JniBlockMeta findBlockMetadata(Long height)
-
rewindBlockMetadataToHeight
abstract Unit rewindBlockMetadataToHeight(Long height)
-
getTotalTransparentBalance
abstract Long getTotalTransparentBalance(String address)
-
putUtxo
abstract Unit putUtxo(ByteArray txId, Integer index, ByteArray script, Long value, Long height)
-
setTransactionStatus
abstract Unit setTransactionStatus(ByteArray txId, Long status)
-
withWallet
<T extends Any> <ERROR CLASS> withWallet(SuspendFunction2<File, Integer, T> block)
-
getNetworkId
abstract Integer getNetworkId()
-
getDataDbFile
abstract File getDataDbFile()
-
-
-
-