<pre><code> tx = await app.createPaymentTransactionNew(
      inputs,
      paths,
      derivationPath,
      serializedOutputs, // app.serializeTransactionOutputs({ outputs }).toString('hex')
      undefined,
      undefined,
      true,
      undefined,
      ['bech32']
    )
</code></pre>

CC BY-SA 4.0
2021-06-03T11:09:39.300Z
2021-06-03T11:09:39.300Z
MCCCS
<p>How to properly call createPaymentTransactionNew using @ledgerhq/hw-app-bt to spend utxos from a bech32 transaction?</p>
<p>This is the code I'm using to call it, having previously defined <code>inputs</code> and <code>purpose, coinPath, accountNumber</code>:</p>
<pre><code>tx = await appBtc.createPaymentTransactionNew({
                    inputs: inputs,
                    associatedKeysets: `${purpose}'/${coinPath}'/${accountNumber}'/0/0`,
                    outputScriptHex: outputScriptHex,
                    segwit:true,
                    additionals: [&quot;bech32&quot;]
                });
</code></pre>

<ledger-hardware-wallet><node.js><p2wpkh>
createPaymentTransactionNew with Bech32 address
Federico Caccia
# createPaymentTransactionNew with Bech32 address

(Asked by: username_0 on 2021-03-16)

How to properly call createPaymentTransactionNew using @ledgerhq/hw-app-bt to spend utxos from a bech32 transaction?

This is the code I'm using to call it, having previously defined `inputs` and `purpose, coinPath, accountNumber`:

```
tx = await appBtc.createPaymentTransactionNew({
                    inputs: inputs,
                    associatedKeysets: `${purpose}'/${coinPath}'/${accountNumber}'/0/0`,
                    outputScriptHex: outputScriptHex,
                    segwit:true,
                    additionals: ["bech32"]
                });

```

**Tags:** ledger-hardware-wallet, node.js, p2wpkh


---

## 1 answers

### Answer by username_1 on 2021-06-03. Score: 0

```
 tx = await app.createPaymentTransactionNew(
      inputs,
      paths,
      derivationPath,
      serializedOutputs, // app.serializeTransactionOutputs({ outputs }).toString('hex')
      undefined,
      undefined,
      true,
      undefined,
      ['bech32']
    )

```


---

