Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Dec 23, 2024
1 parent 86a3486 commit 2b91843
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 24 deletions.
44 changes: 32 additions & 12 deletions docs/src/inscriptions/recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -3231,36 +3231,56 @@ curl -s -H "Accept: application/json" \
}
```

Server running with runes and inscriptions index:
Server running with runes, inscriptions and sats index:

```bash
curl -s -H "Accept: application/json" \
http://0.0.0.0:80/r/utxo/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b:0
http://0.0.0.0:80/r/utxo/626860df36c1047194866c6812f04c15ab84f3690e7cc06fd600c841f1943e05:0
```

```json
{
"inscriptions": [],
"runes": {},
"sat_ranges": null,
"value": 5000000000
"runes": {
"UNCOMMON•GOODS": {
"amount": 6845,
"divisibility": 0,
"symbol": ""
}
},
"sat_ranges": [
[
1905800627509113,
1905800627509443
]
],
"value": 330
}
```

Multiple assets in output with server running with runes, inscriptions and sats
index:
Multiple assets in output with server running with runes and inscriptions index
but no sats index.
sats index:

```bash
curl -s -H "Accept: application/json" \
http://0.0.0.0:80/r/utxo/
http://0.0.0.0:80/r/utxo/626860df36c1047194866c6812f04c15ab84f3690e7cc06fd600c841f1943e05:0
```

```json
{
"inscriptions": [], // TODO
"runes": {}, // TODO
"sat_ranges": [], // TODO
"value": 5000000000
"inscriptions": [
"6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0"
],
"runes": {
"UNCOMMON•GOODS": {
"amount": 6845,
"divisibility": 0,
"symbol": ""
}
},
"sat_ranges": null,
"value": 330
}
```
</details>
Expand Down
16 changes: 4 additions & 12 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2371,19 +2371,11 @@ impl Index {
return Ok(None);
};

let inscriptions = self.get_inscriptions_for_output(outpoint)?;

let runes = self.get_rune_balances_for_output(outpoint)?;

let sat_ranges = self.list(outpoint)?;

let value = utxo_entry.value().parse(self).total_value();

Ok(Some(api::UtxoRecursive {
inscriptions,
runes,
sat_ranges,
value,
inscriptions: self.get_inscriptions_for_output(outpoint)?,
runes: self.get_rune_balances_for_output(outpoint)?,
sat_ranges: self.list(outpoint)?,
value: utxo_entry.value().parse(self).total_value(),
}))
}

Expand Down

0 comments on commit 2b91843

Please sign in to comment.