@exodus/bitcoin-api 2.7.7-taprootpatch → 2.7.7

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.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/src/utxos-utils.js +6 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.7.7-taprootpatch",
3
+ "version": "2.7.7",
4
4
  "description": "Exodus bitcoin-api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -42,5 +42,6 @@
42
42
  "@scure/base": "^1.1.3",
43
43
  "@scure/btc-signer": "^1.1.0",
44
44
  "jest-when": "^3.5.1"
45
- }
45
+ },
46
+ "gitHead": "4e504c29d0a5e436a5766d42d4664eaf53b06bc2"
46
47
  }
@@ -69,7 +69,7 @@ export function getValidInscriptions({ utxo }) {
69
69
  )
70
70
  }
71
71
 
72
- function isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress }) {
72
+ function isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds }) {
73
73
  if (!ordinalsEnabled) {
74
74
  return false
75
75
  }
@@ -85,27 +85,18 @@ function isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddr
85
85
  }
86
86
 
87
87
  const validInscriptions = getValidInscriptions({ utxo })
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
88
+ return validInscriptions.length > 0
98
89
  }
99
90
 
100
- export function partitionUtxos({ allUtxos, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress }) {
91
+ export function partitionUtxos({ allUtxos, ordinalsEnabled, knownBalanceUtxoIds }) {
101
92
  assert(allUtxos, 'allUtxos is required')
102
- if (ordinalsEnabled) assert(ordinalAddress, 'ordinalAddress is required') // not used atm we may need to tune by ordinalAddress when unconfirmed or rubbish inscriptions
93
+ // assert(ordinalAddress, 'ordinalAddress is required') // not used atm we may need to tune by ordinalAddress when unconfirmed or rubbish inscriptions
103
94
  return {
104
95
  utxos: allUtxos.filter(
105
- (utxo) => !isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress })
96
+ (utxo) => !isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds })
106
97
  ),
107
98
  ordinalsUtxos: allUtxos.filter((utxo) =>
108
- isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds, ordinalAddress })
99
+ isOrdinalUtxo({ utxo, ordinalsEnabled, knownBalanceUtxoIds })
109
100
  ),
110
101
  }
111
102
  }