<p>It appears that<code>walletHandle</code> is not what lucid expects</p>
<p><a href="https://lucid.spacebudz.io/docs/getting-started/choose-wallet/#select-wallet-from-browser" rel="nofollow noreferrer">From the docs</a> it appears that it wants the already &quot;resolved&quot; wallet API</p>
<p>On a side note, lucid is no longer maintained</p>
<p>To avoid other surprises either switch to one of the forks or try out <a href="https://pluts.harmoniclabs.tech/offchain/cardano-ledger-ts/classes/Tx#fromcbor" rel="nofollow noreferrer">plu-ts-offchain</a></p>

CC BY-SA 4.0
2024-08-02T20:48:51.520Z
Thanks Michele! `walletHandle` was indeed one of the issues. Once that one was fixed, it was easier to implement the multisig as expected.
I will also look at lucid alternatives, but my shitty website had already it integrated and was looking for a quick win. As soon as I have a moment will check plu-ts! 
Thank you
Giovanni G
CC BY-SA 4.0
2024-08-02T19:03:35.907Z
2024-08-02T19:03:35.907Z
Michele Nuzzi
<p>Right,</p>
<p>eventually found the issue(s),</p>
<p>in this line</p>
<p><code>lucid.selectWallet(walletHandle)</code></p>
<p>the <code>walletHandle</code> was not correctly setup, and lead to the <code>TypeError: api.signTx is not a function</code></p>
<p>More over, in case of multisig instead of <code>sign</code> the <code>partialSign</code> must be used instead.</p>
<p>The new code looks something like:</p>
<pre><code>lucid.selectWallet(walletHandle)
const witness = await lucid.fromTx(txBytes).partialSign()
const txSigned = await ucid.fromTx(txBytes).assemble([witness]).complete()txSigned.submit()
</code></pre>
<p>Thanks to all the people that helped!</p>

CC BY-SA 4.0
2024-08-02T20:47:48.557Z
2024-08-02T20:47:48.557Z
Giovanni G
<p>try</p>
<p>const tx = lucid.newTx(txHexBytes).complete()</p>
<p>const txSigned = await tx.sign().complete();</p>

CC BY-SA 4.0
2024-08-02T19:34:32.603Z
2024-08-02T19:43:24.663Z
2024-08-02T19:43:24.663Z
Griffin St. Louis
<p>I'm working on a project that requires 2 wallets to sign a transaction.</p>
<p>The backend, written in java, produces a hex encoded version of the TX that is correctly processed by Eternl. Once imported the tx in Eternl, I can just sign and submit it and everything works like a charm.</p>
<p>I am now trying to integrated the frontend by fetching the pre-half-signed-transaction from the backend, import into lucid, and sign via eternl.</p>
<p>What I'm strugging with is loading the TX in lucid.</p>
<p>What I'm doing is:</p>
<pre><code>
  const sign = async () =&gt; {

    const lucid = await Lucid.new(
      new Blockfrost(getBlockfrostUrl(network), getBlockfrostKey(network)),
      &quot;Mainnet&quot;,
    );

    lucid.selectWallet(walletHandle)

    const tx = lucid.fromTx(txHexBytes)
    const signedTx = await tx.sign().complete()
    signedTx.submit()
  }
</code></pre>
<p>But I get the following error:</p>
<pre><code>lucid.js:274 Uncaught (in promise) TypeError: api.signTx is not a function
    at Object.signTx (lucid.js:274:46)
    at eval (tx_complete.js:70:55)
    at TxComplete.complete (tx_complete.js:110:19)
    at sign (whatever.tsx:167:38)
    ```


Any ideas?

Alternatively, can you point to a lucid multisig example?

Thanks
</code></pre>

<lucid><multisig>
Lucid multisig transaction
# Lucid multisig transaction

(Asked by: username_0 on 2024-08-02)

I'm working on a project that requires 2 wallets to sign a transaction.
The backend, written in java, produces a hex encoded version of the TX that is correctly processed by Eternl. Once imported the tx in Eternl, I can just sign and submit it and everything works like a charm.
I am now trying to integrated the frontend by fetching the pre-half-signed-transaction from the backend, import into lucid, and sign via eternl.
What I'm strugging with is loading the TX in lucid.
What I'm doing is:

  const sign = async () => {

    const lucid = await Lucid.new(
      new Blockfrost(getBlockfrostUrl(network), getBlockfrostKey(network)),
      "Mainnet",
    );

    lucid.selectWallet(walletHandle)

    const tx = lucid.fromTx(txHexBytes)
    const signedTx = await tx.sign().complete()
    signedTx.submit()
  }

But I get the following error:
lucid.js:274 Uncaught (in promise) TypeError: api.signTx is not a function
    at Object.signTx (lucid.js:274:46)
    at eval (tx_complete.js:70:55)
    at TxComplete.complete (tx_complete.js:110:19)
    at sign (whatever.tsx:167:38)
    ```


Any ideas?

Alternatively, can you point to a lucid multisig example?

Thanks

**Tags:** lucid, multisig

---

## 3 answers

### Answer by username_1 on 2024-08-02. Score: 1

It appears that`walletHandle` is not what lucid expects

[From the docs](https://lucid.spacebudz.io/docs/getting-started/choose-wallet/#select-wallet-from-browser) it appears that it wants the already "resolved" wallet API

On a side note, lucid is no longer maintained

To avoid other surprises either switch to one of the forks or try out [plu-ts-offchain](https://pluts.harmoniclabs.tech/offchain/cardano-ledger-ts/classes/Tx#fromcbor)

> **Comments:**
> **username_0**: Thanks Michele! `walletHandle` was indeed one of the issues. Once that one was fixed, it was easier to implement the multisig as expected. I will also look at lucid alternatives, but my shitty website had already it integrated and was looking for a quick win. As soon as I have a moment will check plu-ts!  Thank you  

---

### Answer by username_0 on 2024-08-02. Score: 0

Right,
eventually found the issue(s),
in this line
lucid.selectWallet(walletHandle)
the walletHandle was not correctly setup, and lead to the TypeError: api.signTx is not a function
More over, in case of multisig instead of sign the partialSign must be used instead.
The new code looks something like:
lucid.selectWallet(walletHandle)
const witness = await lucid.fromTx(txBytes).partialSign()
const txSigned = await ucid.fromTx(txBytes).assemble([witness]).complete()txSigned.submit()

Thanks to all the people that helped!


---

### Answer by username_2 on 2024-08-02. Score: 0

try

const tx = lucid.newTx(txHexBytes).complete()

const txSigned = await tx.sign().complete();


---

