diff --git a/cli/src/command.rs b/cli/src/command.rs index abc2e40..a8289fe 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -150,11 +150,11 @@ pub enum Command { /// Fee fee: Sats, - /// File for generated PSBT - psbt: PathBuf, - /// File for generated transfer consignment consignment: PathBuf, + + /// Name of PSBT file to save. If not given, prints PSBT to STDOUT + psbt: Option, }, /// Inspects any RGB data file @@ -572,13 +572,26 @@ impl Exec for RgbArgs { psbt: psbt_filename, consignment: out_file, } => { + // 1. BP Wallet: Do coin selection (using Layer2 components) + // 2. BP Wallet: Construct PSBT prototype (no state transitions) + // ... complete PSBT structure updates in multi-party protocols + // 3. RGB Std: Prepare stencil - main state transition and blank state + // transitions + // 4. RGB PSBT: Embed stencil into PSBT + // ... complete PSBT client-side updates in multi-party protocols + // 5. RGB PSBT: Anchorize PSBT, extract disclosure + // 6. RGB Std: Merge disclosure into the stash, cache and index + // 7. RGB Std: Prepare consignment + let mut runtime = self.rgb_runtime(&config)?; + // TODO: Support lock time and RBFs + let params = TxParams::with(*fee); + eprint!("Constructing PSBT ... "); - let mut psbt = - runtime - .wallet_mut() - .construct_psbt(coins, Invoice, TxParams::with(*fee))?; + let mut psbt = runtime + .wallet_mut() + .construct_psbt(coins, Invoice, params)?; eprintln!("success"); eprint!("Constructing transfer consignment ... "); diff --git a/src/pay.rs b/src/pay.rs index 89267be..dcf423f 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -200,7 +200,8 @@ impl Runtime { } }; - // 3. Prepare and self-consume other transitions + // 3. Prepare other transitions + // Enumerate state let mut contract_inputs = HashMap::>::new(); let mut spent_state = HashMap::>::new(); for outpoint in prev_outpoints { @@ -215,7 +216,7 @@ impl Runtime { .extend(self.state_for_outpoints(id, [outpoint])?); } } - // Construct blank transitions, self-consume them + // Construct blank transitions let mut other_transitions = HashMap::with_capacity(spent_state.len()); for (id, opouts) in spent_state { let mut blank_builder = self.blank_builder(id, iface.clone())?;