Summary
The current Apply flow splits work across 2-3 transactions:
- TX1: Create binding + create condition objects + share them
- (wait for confirmation + extract IDs from effects)
- TX2: Set policies using condition IDs from TX1
This can be collapsed into a single PTB by extracting condition IDs before sharing:
condition_everyone::new() → cond
condition_everyone::id(&cond) → cond_id // get ID while we still have a reference
condition_everyone::share(cond) // now share it
rule(cond_id, effect) → rule // use the ID
set_policy(binding, assembly_id, rules)
Benefits
- Single wallet signature instead of 2-3
- No waiting for TX1 confirmation before TX2
- No fragile ID extraction from transaction effects
- Lower total gas (fewer transaction overheads)
- Better UX — one click, one sign, done
Current workaround
The DApp reads condition IDs from getTransaction() effects after TX1, stores them in localStorage, then builds TX2. This is fragile and has caused multiple bugs.
🤖 Generated with Claude Code
Summary
The current Apply flow splits work across 2-3 transactions:
This can be collapsed into a single PTB by extracting condition IDs before sharing:
Benefits
Current workaround
The DApp reads condition IDs from
getTransaction()effects after TX1, stores them in localStorage, then builds TX2. This is fragile and has caused multiple bugs.🤖 Generated with Claude Code