From 9b0c7a91f657d2bcfa4fa2099cf6f9e3c66d61f2 Mon Sep 17 00:00:00 2001 From: microproofs Date: Sat, 23 Dec 2023 16:47:12 -0500 Subject: [PATCH] start on spend from account action --- validators/account.ak | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/validators/account.ak b/validators/account.ak index 82cad40..6f7a0d0 100644 --- a/validators/account.ak +++ b/validators/account.ak @@ -67,6 +67,9 @@ type Intention { condition: IntentionCondition, value_leaving: List<(PolicyId, AssetName, Int)>, nonce: OutputReference, + /// User to track ordering number. Useful for dexes to ensure + /// your order is applied in a specific order + order: Int, } type DataEnvelope { @@ -194,6 +197,22 @@ validator { expect rdr: ValidateRedeemer = rdr when rdr is { + SpendFromAccount(data_envelopes) -> { + let split_intentions = + fn(ref_input: Input, acc) { + let Input { output: Output { address, value, datum, .. }, .. } = + ref_input + + if address.payment_credential == pc { + todo + } else { + acc + } + } + + todo + } + OwnerSpend(control_index) -> validate_account_spend( control_index, @@ -204,7 +223,8 @@ validator { NonceState, ) - SpendFromAccount(data_envelope) -> todo + // This allows for the account to support vaults of unspendable assets + // and only the VaultSpend action can move these assets VaultSpend(control_index) -> validate_account_spend( control_index,