Repository: ergoplatform/sigma-rust (language: rust)

Issue:
Wasm bindings: missing a function to sign a MultiSig input in js
I have a transaction with 2 inputs and currently no way to sign it in javascript.

```
┌───────────────────────────┐             ┌─────────────────────────┐
│ address: alicePK          │  ──┐        │  address: ALICE         │
│ value:   1Erg             │    │   ┌──► │  value:   2.9989Erg     │
└───────────────────────────┘    │   │    └─────────────────────────┘
                                 ├──►│
┌───────────────────────────┐    │   │    ┌─────────────────────────┐
│ address: alicePK && bobPk │    │   │    │  address: FEE           │
│ value:   2ERG             │  ──┘   └──► │  value:   0.0011Erg     │
└───────────────────────────┘             └─────────────────────────┘
```



Discussion / hints:

Fix patch:
diff --git a/bindings/ergo-lib-wasm/src/wallet.rs b/bindings/ergo-lib-wasm/src/wallet.rs
index 3e962de70..9994f6dfb 100644
--- a/bindings/ergo-lib-wasm/src/wallet.rs
+++ b/bindings/ergo-lib-wasm/src/wallet.rs
@@ -218,4 +218,35 @@ impl Wallet {
             .map_err(to_js)
             .map(Input::from)
     }
+
+    /// Sign a given multi-signature tx input
+    #[wasm_bindgen]
+    pub fn sign_tx_input_multi(
+        &self,
+        input_idx: usize,
+        state_context: &ErgoStateContext,
+        tx: &UnsignedTransaction,
+        boxes_to_spend: &ErgoBoxes,
+        data_boxes: &ErgoBoxes,
+        tx_hints: &TransactionHintsBag,
+    ) -> Result<Input, JsValue> {
+        let boxes_to_spend = boxes_to_spend.clone().into();
+        let data_boxes = data_boxes.clone().into();
+        let tx_context = ergo_lib::wallet::signing::TransactionContext::new(
+            tx.0.clone(),
+            boxes_to_spend,
+            data_boxes,
+        )
+        .map_err(to_js)?;
+        let state_context_inner = state_context.clone().into();
+        self.0
+            .sign_tx_input(
+                input_idx,
+                tx_context,
+                &state_context_inner,
+                Some(&tx_hints.0),
+            )
+            .map_err(to_js)
+            .map(Input::from)
+    }
 }


Test patch: