2023-02-06 06:41:38 -08:00
|
|
|
package cash.z.ecc.android.sdk.model
|
2022-12-23 02:00:37 -08:00
|
|
|
|
|
|
|
import cash.z.ecc.android.sdk.Synchronizer
|
|
|
|
|
2024-03-14 06:40:40 -07:00
|
|
|
data class ZecSend(
|
|
|
|
val destination: WalletAddress,
|
|
|
|
val amount: Zatoshi,
|
|
|
|
val memo: Memo,
|
|
|
|
val proposal: Proposal?
|
|
|
|
) {
|
2022-12-23 02:00:37 -08:00
|
|
|
companion object
|
|
|
|
}
|
|
|
|
|
2024-01-04 12:21:32 -08:00
|
|
|
suspend fun Synchronizer.send(
|
|
|
|
spendingKey: UnifiedSpendingKey,
|
|
|
|
send: ZecSend
|
2024-02-19 14:43:49 -08:00
|
|
|
) = createProposedTransactions(
|
|
|
|
proposeTransfer(
|
|
|
|
spendingKey.account,
|
|
|
|
send.destination.address,
|
|
|
|
send.amount,
|
|
|
|
send.memo.value
|
|
|
|
),
|
|
|
|
spendingKey
|
2022-12-23 02:00:37 -08:00
|
|
|
)
|
2024-03-13 02:03:53 -07:00
|
|
|
|
2024-03-14 06:40:40 -07:00
|
|
|
/**
|
|
|
|
* This is just a syntactic sugar function for [Synchronizer.proposeTransfer]
|
|
|
|
*/
|
2024-03-13 02:03:53 -07:00
|
|
|
suspend fun Synchronizer.proposeSend(
|
2024-03-14 06:40:40 -07:00
|
|
|
account: Account,
|
2024-03-13 02:03:53 -07:00
|
|
|
send: ZecSend
|
|
|
|
) = proposeTransfer(
|
2024-03-14 06:40:40 -07:00
|
|
|
account,
|
2024-03-13 02:03:53 -07:00
|
|
|
send.destination.address,
|
|
|
|
send.amount,
|
|
|
|
send.memo.value
|
|
|
|
)
|