@exodus/bitcoin-api 2.7.7-fix → 2.7.7-taprootpatch
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/fee/can-bump-tx.js +1 -1
- package/src/utxos-utils.js +15 -6
package/package.json
CHANGED
package/src/fee/can-bump-tx.js
CHANGED
|
@@ -100,7 +100,7 @@ const _canBumpTx = ({
|
|
|
100
100
|
allowUnconfirmedRbfEnabledUtxos,
|
|
101
101
|
})
|
|
102
102
|
|
|
103
|
-
return fee ? { bumpType: BumpType.CPFP
|
|
103
|
+
return fee ? { bumpType: BumpType.CPFP } : { errorMessage: 'insufficient funds' }
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
const validateIsNumber = (number, name) => {
|
package/src/utxos-utils.js
CHANGED
|
@@ -69,7 +69,7 @@ export function getValidInscriptions({ utxo }) {
|
|
|
69
69
|
)
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds }) {
|
|
72
|
+
function isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress }) {
|
|
73
73
|
if (!ordinalsEnabled) {
|
|
74
74
|
return false
|
|
75
75
|
}
|
|
@@ -85,18 +85,27 @@ function isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds }) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
const validInscriptions = getValidInscriptions({ utxo })
|
|
88
|
-
|
|
88
|
+
const hasOrdinals = validInscriptions.length > 0
|
|
89
|
+
|
|
90
|
+
if (ordinalAddress?.toString() === utxo.address.toString()) {
|
|
91
|
+
// ordinalAddress is the taproot address
|
|
92
|
+
if (!hasOrdinals) {
|
|
93
|
+
console.log('Excluding utxo from btc spending:', utxo.address.toString(), utxo)
|
|
94
|
+
}
|
|
95
|
+
return true // assume is ordinal just in case
|
|
96
|
+
}
|
|
97
|
+
return hasOrdinals
|
|
89
98
|
}
|
|
90
99
|
|
|
91
|
-
export function partitionUtxos({ allUtxos, ordinalsEnabled, knownBalanceUtxoIds }) {
|
|
100
|
+
export function partitionUtxos({ allUtxos, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress }) {
|
|
92
101
|
assert(allUtxos, 'allUtxos is required')
|
|
93
|
-
|
|
102
|
+
if (ordinalsEnabled) assert(ordinalAddress, 'ordinalAddress is required') // not used atm we may need to tune by ordinalAddress when unconfirmed or rubbish inscriptions
|
|
94
103
|
return {
|
|
95
104
|
utxos: allUtxos.filter(
|
|
96
|
-
(utxo) => !isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds })
|
|
105
|
+
(utxo) => !isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress })
|
|
97
106
|
),
|
|
98
107
|
ordinalsUtxos: allUtxos.filter((utxo) =>
|
|
99
|
-
isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds })
|
|
108
|
+
isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress })
|
|
100
109
|
),
|
|
101
110
|
}
|
|
102
111
|
}
|