From 03111f05da17f03af93f2a090f5301e3048662fb Mon Sep 17 00:00:00 2001 From: Luis Covarrubias Date: Fri, 13 Feb 2026 09:52:22 -0800 Subject: [PATCH] fix(wasm-solana): return empty string for unsigned (all-zeros) signatures The parse_transaction function was blindly converting all signatures to base58, causing all-zeros placeholder signatures to become '1111111111111111111111111111111111111111111111111111111111111111'. Now checks each signature for all-zeros and returns empty string instead, matching the behavior of Transaction::id() which returns None for unsigned transactions. BTC-3025 --- packages/wasm-solana/src/parser.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/wasm-solana/src/parser.rs b/packages/wasm-solana/src/parser.rs index 1bdb2ed..b0e2f26 100644 --- a/packages/wasm-solana/src/parser.rs +++ b/packages/wasm-solana/src/parser.rs @@ -153,8 +153,21 @@ pub fn parse_transaction(bytes: &[u8]) -> Result { // Note: Instruction combining (e.g., CreateAccount + StakeInitialize → StakingActivate) // is handled by TypeScript in mapWasmInstructionsToBitGoJS for flexibility - // Extract signatures as base58 strings - let signatures: Vec = tx.signatures.iter().map(|s| s.to_string()).collect(); + // Extract signatures as base58 strings. + // All-zeros signatures (unsigned placeholder slots) are returned as empty strings + // so the JS side can simply use `signatures[0] || 'UNAVAILABLE'`. + let signatures: Vec = tx + .signatures + .iter() + .map(|s| { + let bytes: &[u8] = s.as_ref(); + if bytes.iter().all(|&b| b == 0) { + String::new() + } else { + s.to_string() + } + }) + .collect(); Ok(ParsedTransaction { fee_payer,