diff --git a/wallet/src/builder.rs b/wallet/src/builder.rs index 1ced069..81a39bc 100644 --- a/wallet/src/builder.rs +++ b/wallet/src/builder.rs @@ -568,6 +568,16 @@ impl Iterator for BuilderIterator<'_> { ); } } + if !params.sends.is_empty() { + // TODO: resolved address recipient + for send in ¶ms.sends { + detailed_tx.add_send( + send.amount, + None, + send.recipient.script_pubkey(), + ); + } + } Some(Ok(detailed_tx)) } StackOp::Open(params) => { @@ -789,6 +799,7 @@ impl Builder { } if !opens.is_empty() || !transfers.is_empty() + || !sends.is_empty() || !executes.is_empty() || auction_outputs.is_some() { @@ -796,7 +807,7 @@ impl Builder { opens, executes, transfers, - sends: vec![], + sends, bidouts: auction_outputs, })); } diff --git a/wallet/src/tx_event.rs b/wallet/src/tx_event.rs index 9204163..3a977e1 100644 --- a/wallet/src/tx_event.rs +++ b/wallet/src/tx_event.rs @@ -51,7 +51,7 @@ pub struct BidoutEventDetails { pub struct SendEventDetails { #[serde(skip_serializing_if = "Option::is_none")] pub to_space: Option, - pub resolved_address: ScriptBuf, + pub script_pubkey: ScriptBuf, pub amount: Amount, } @@ -344,7 +344,7 @@ impl TxRecord { details: Some( serde_json::to_value(SendEventDetails { to_space, - resolved_address, + script_pubkey: resolved_address, amount, }) .expect("json value"), @@ -526,6 +526,7 @@ impl FromStr for TxEventKind { "send" => Ok(TxEventKind::Send), "script" => Ok(TxEventKind::Script), "fee-bump" => Ok(TxEventKind::FeeBump), + "buy" => Ok(TxEventKind::Buy), _ => Err("invalid event kind"), } }