diff --git a/docs/src/guides/api.md b/docs/src/guides/api.md
index c368d036e2..f53f77afc0 100644
--- a/docs/src/guides/api.md
+++ b/docs/src/guides/api.md
@@ -5129,4 +5129,4 @@ curl -s -H "Accept: application/json" \
See [Recursion](../inscriptions/recursion.md) for an explanation of these.
-{{#include ../inscriptions/recursion.md:35:3371}}
+{{#include ../inscriptions/recursion.md:35:3429}}
diff --git a/docs/src/inscriptions/recursion.md b/docs/src/inscriptions/recursion.md
index abb151bc9c..c8d8a1d7bf 100644
--- a/docs/src/inscriptions/recursion.md
+++ b/docs/src/inscriptions/recursion.md
@@ -3370,6 +3370,64 @@ curl -s -H "Accept: application/json" \
```
+
+
+ GET
+ /r/utxo/<OUTPOINT>
+
+
+### Description
+
+Get assets held by an unspent transaction output.
+
+### Examples
+
+Unspent transaction output with server without any indices:
+
+```bash
+curl -s -H "Accept: application/json" \
+ http://0.0.0.0:80/r/utxo/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b:0
+```
+
+```json
+{
+ "inscriptions": null,
+ "runes": null,
+ "sat_ranges": null,
+ "value": 5000000000
+}
+```
+
+With rune, inscription, and sat index:
+
+```bash
+curl -s -H "Accept: application/json" \
+ http://0.0.0.0:80/r/utxo/626860df36c1047194866c6812f04c15ab84f3690e7cc06fd600c841f1943e05:0
+```
+
+```json
+{
+ "inscriptions": [
+ "6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0"
+ ],
+ "runes": {
+ "UNCOMMON•GOODS": {
+ "amount": 6845,
+ "divisibility": 0,
+ "symbol": "⧉"
+ }
+ },
+ "sat_ranges": [
+ [
+ 1905800627509113,
+ 1905800627509443
+ ]
+ ],
+ "value": 330
+}
+```
+
+
diff --git a/src/api.rs b/src/api.rs
index 5b335c48e0..9675f5f3d2 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -151,6 +151,14 @@ pub struct Inscriptions {
pub page_index: u32,
}
+#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+pub struct UtxoRecursive {
+ pub inscriptions: Option>,
+ pub runes: Option>,
+ pub sat_ranges: Option>,
+ pub value: u64,
+}
+
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub struct Output {
pub address: Option>,
diff --git a/src/index.rs b/src/index.rs
index b5e035b668..16122a6ee8 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -2358,6 +2358,27 @@ impl Index {
Ok(acc)
}
+ pub(crate) fn get_utxo_recursive(
+ &self,
+ outpoint: OutPoint,
+ ) -> Result