zcash-android-wallet-sdk / cash.z.wallet.sdk.transaction / WalletTransactionEncoder / createTransaction

createTransaction

suspend fun createTransaction(spendingKey: String, zatoshi: Long, toAddress: String, memo: ByteArray?, fromAccountIndex: Int): EncodedTransaction

Creates a transaction, throwing an exception whenever things are missing. When the provided wallet implementation doesn't throw an exception, we wrap the issue into a descriptive exception ourselves (rather than using double-bangs for things).

Parameters

spendingKey - the key associated with the notes that will be spent.

zatoshi - the amount of zatoshi to send.

toAddress - the recipient's address.

memo - the optional memo to include as part of the transaction.

fromAccountIndex - the optional account id to use. By default, the 1st account is used.

Return
the successfully encoded transaction or an exception