Skip to content

Commit

Permalink
Fixed failure to spend utxos from v2 wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
joemarct committed Sep 13, 2021
1 parent f877ff4 commit 490e92e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "watchtower-cash-js",
"version": "0.1.18",
"version": "0.1.19",
"description": "Library for building Javascript applications that integrate with Watchtower.cash",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/bch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class BCH {
tx_hash: item.txid,
tx_pos: item.vout,
value: new BigNumber(item.value),
wallet_index: item.wallet_index
wallet_index: item.wallet_index,
address_path: item.address_path
}
})
}
Expand Down Expand Up @@ -102,6 +103,7 @@ class BCH {
for (let i = 0; i < bchUtxos.utxos.length; i++) {
transactionBuilder.addInput(bchUtxos.utxos[i].tx_hash, bchUtxos.utxos[i].tx_pos)
totalInput = totalInput.plus(bchUtxos.utxos[i].value)
let utxoKeyPair
if (walletHash) {
let addressPath
if (bchUtxos.utxos[i].address_path) {
Expand Down
7 changes: 4 additions & 3 deletions src/slp/nft1/child/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class SlpNft1Child {
} else {
resp = await this._api.get(`utxo/slp/${handle}/${tokenId}/?token_type=65`)
}
console.log(resp.data)
let cumulativeAmount = new BigNumber(0)
let tokenDecimals = 0
let filteredUtxos = []
Expand Down Expand Up @@ -54,7 +53,8 @@ class SlpNft1Child {
tx_pos: item.vout,
amount: amount,
value: dustLimit,
wallet_index: item.wallet_index
wallet_index: item.wallet_index,
address_path: item.address_path
}
})
return {
Expand Down Expand Up @@ -89,7 +89,8 @@ class SlpNft1Child {
tx_hash: item.txid,
tx_pos: item.vout,
value: new BigNumber(item.value),
wallet_index: item.wallet_index
wallet_index: item.wallet_index,
address_path: item.address_path
}
})
}
Expand Down
6 changes: 4 additions & 2 deletions src/slp/type1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class SlpType1 {
tx_pos: item.vout,
amount: amount,
value: dustLimit,
wallet_index: item.wallet_index
wallet_index: item.wallet_index,
address_path: item.address_path
}
})
return {
Expand Down Expand Up @@ -88,7 +89,8 @@ class SlpType1 {
tx_hash: item.txid,
tx_pos: item.vout,
value: new BigNumber(item.value),
wallet_index: item.wallet_index
wallet_index: item.wallet_index,
address_path: item.address_path
}
})
}
Expand Down

0 comments on commit 490e92e

Please sign in to comment.