Skip to content

Commit e473e78

Browse files
authored
Get output information by address (ordinals#4056)
1 parent c01279c commit e473e78

File tree

8 files changed

+4808
-4323
lines changed

8 files changed

+4808
-4323
lines changed

docs/book.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cname = "docs.ordinals.com"
1414
default-theme = "coal"
1515
git-repository-url = "https://github.com/ordinals/ord"
1616
preferred-dark-theme = "coal"
17-
additional-css = ["language-picker.css"]
17+
additional-css = ["index.css"]
1818

1919
[output.linkcheck]
2020

docs/language-picker.css renamed to docs/index.css

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
table {
2+
float: left;
3+
}
4+
15
#language-list {
26
left: auto;
37
right: 10px;

docs/src/guides/api.md

+4,435-4,320
Large diffs are not rendered by default.

docs/src/inscriptions/recursion.md

+55-2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ Recursion has a number of interesting use-cases:
3939
</summary>
4040

4141
### Description
42-
The content of the inscription with `<INSCRIPTION_ID>`
42+
43+
The content of the inscription with `<INSCRIPTION_ID>`.
4344

4445
### Example
46+
4547
```bash
4648
curl -s -H "Accept: application/json" \
4749
http://0.0.0.0:80/content/6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0 > skull.jpg
4850
```
51+
4952
<i>no terminal output, just file creation</i>
5053
</details>
5154

@@ -63,6 +66,7 @@ Latest block hash.
6366
curl -s \
6467
http://0.0.0.0:80/r/blockhash
6568
```
69+
6670
```json
6771
"00000000000000000002891b440944e0ce40b37b6ccaa138c280e9edfc319d5d"
6872
```
@@ -75,13 +79,16 @@ curl -s \
7579
</summary>
7680

7781
### Description
82+
7883
Block hash at given block height as JSON string.
7984

8085
### Example
86+
8187
```bash
8288
curl -s \
8389
http://0.0.0.0:80/r/blockhash/840000
8490
```
91+
8592
```json
8693
"0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5"
8794
```
@@ -94,13 +101,16 @@ curl -s \
94101
</summary>
95102

96103
### Description
104+
97105
Latest block height.
98106

99107
### Example
108+
100109
```bash
101110
curl -s \
102111
http://0.0.0.0:80/r/blockheight
103112
```
113+
104114
```json
105115
866393
106116
```
@@ -113,13 +123,16 @@ curl -s \
113123
</summary>
114124

115125
### Description
126+
116127
Block info. `<QUERY>` may be a block height or block hash.
117128

118129
### Example (blockheight)
130+
119131
```bash
120132
curl -s -H "Accept: application/json" \
121133
http://0.0.0.0:80/r/blockinfo/0
122134
```
135+
123136
```json
124137
{
125138
"average_fee": 0,
@@ -158,11 +171,14 @@ curl -s -H "Accept: application/json" \
158171
"version": 1
159172
}
160173
```
174+
161175
### Example (blockhash)
176+
162177
```bash
163178
curl -s -H "Accept: application/json" \
164179
http://0.0.0.0:80/r/blockinfo/0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5
165180
```
181+
166182
```json
167183
{
168184
"average_fee": 1234031,
@@ -213,13 +229,16 @@ curl -s -H "Accept: application/json" \
213229
</summary>
214230

215231
### Description
232+
216233
UNIX time stamp of latest block.
217234

218235
### Example
236+
219237
```bash
220238
curl -s \
221239
http://0.0.0.0:80/r/blocktime
222240
```
241+
223242
```json
224243
1729362253
225244
```
@@ -232,13 +251,16 @@ curl -s \
232251
</summary>
233252

234253
### Description
254+
235255
The first 100 child inscription ids.
236256

237257
### Example
258+
238259
```bash
239260
curl -s -H "Accept: application/json" \
240261
http://0.0.0.0:80/r/children/e317a2a5d68bd1004ae15a06175a319272a10389ff125c98820389edef8b0a94i0
241262
```
263+
242264
```json
243265
{
244266
"ids": [
@@ -356,13 +378,16 @@ curl -s -H "Accept: application/json" \
356378
</summary>
357379

358380
### Description
381+
359382
The set of 100 child inscription ids on `<PAGE>`.
360383

361384
### Example
385+
362386
```bash
363387
curl -s -H "Accept: application/json" \
364388
http://0.0.0.0:80/r/children/e317a2a5d68bd1004ae15a06175a319272a10389ff125c98820389edef8b0a94i0/9
365389
```
390+
366391
```json
367392
{
368393
"ids": [
@@ -480,13 +505,16 @@ curl -s -H "Accept: application/json" \
480505
</summary>
481506

482507
### Description
508+
483509
Details of the first 100 child inscriptions.
484510

485511
### Example
512+
486513
```bash
487514
curl -s -H "Accept: application/json" \
488515
http://0.0.0.0:80/r/children/e317a2a5d68bd1004ae15a06175a319272a10389ff125c98820389edef8b0a94i0/inscriptions
489516
```
517+
490518
```json
491519
{
492520
"children": [
@@ -1802,14 +1830,18 @@ curl -s -H "Accept: application/json" \
18021830
</summary>
18031831

18041832
### Description
1833+
18051834
Details of the set of 100 child inscriptions on &lt;PAGE&gt;.
18061835

18071836
### Example
1837+
18081838
```bash
18091839
curl -s -H "Accept: application/json" \
18101840
http://0.0.0.0:80/r/children/e317a2a5d68bd1004ae15a06175a319272a10389ff125c98820389edef8b0a94i0/inscriptions/9
18111841
```
1812-
```json{
1842+
1843+
```json
1844+
{
18131845
"children": [
18141846
{
18151847
"charms": [
@@ -3125,6 +3157,7 @@ curl -s -H "Accept: application/json" \
31253157
</summary>
31263158

31273159
### Description
3160+
31283161
Undelegated content of an inscription.
31293162

31303163
</details>
@@ -3137,13 +3170,16 @@ Undelegated content of an inscription.
31373170
</summary>
31383171

31393172
### Description
3173+
31403174
Information about an inscription.
31413175

31423176
### Example
3177+
31433178
```bash
31443179
curl -s -H "Accept: application/json" \
31453180
http://0.0.0.0:80/r/inscriptions/13130e4b299ed361f2a734f6433844ef0f0211cd504e0ca8f4d4ab20f51b8127i0
31463181
```
3182+
31473183
```json
31483184
{
31493185
"charms": [
@@ -3173,13 +3209,15 @@ curl -s -H "Accept: application/json" \
31733209
</summary>
31743210

31753211
### Description
3212+
31763213
JSON string containing the hex-encoded CBOR metadata.
31773214

31783215
### Example
31793216
```bash
31803217
curl -s -H "Accept: application/json" \
31813218
http://0.0.0.0:80/r/metadata/b1ef66c2d1a047cbaa6260b74daac43813924378fe08ef8545da4cb79e8fcf00i0
31823219
```
3220+
31833221
```json
31843222
"ac6c50484f544f475241504845526a5041524b4552204441596643414d4552416c43414e4f4e20454f532d31566446494c4d6f4b4f44414b20454b54415220313030644c454e53781a5a4549535320504c414e415220542a2038354d4d20462f312e346d5348555454455220535045454465312f31323568415045525455524563462f38664d4f44454c5318646650484f544f531903e8684c4f434154494f4e774c4f5320414e47454c45532c2043414c49464f524e49416443524557a36a415353495354414e4345826e41524941532042555244454c4c49684e4153204e495858664d414b45555087754544454e2053594d4f4e45204c415454414e5a494f6a4d494d49204d455945526e53414d414e544841204c455052456f4c4953455454452053414e54414e416e4a45535349434120564552474f4e63504f4e724d415941204e414b415241205352554f4348644841495283694a414b4920494348556c4a4f43454c594e2056454741724a4546464552534f4e2054414e475241444966504154524f4e6e434153455920524f4441524d4f52674c4943454e534563434330"
31853223
```
@@ -3192,13 +3230,16 @@ curl -s -H "Accept: application/json" \
31923230
</summary>
31933231

31943232
### Description
3233+
31953234
The first 100 parent inscription ids.
31963235

31973236
### Example
3237+
31983238
```bash
31993239
curl -s -H "Accept: application/json" \
32003240
http://0.0.0.0:80/r/parents/b1ef66c2d1a047cbaa6260b74daac43813924378fe08ef8545da4cb79e8fcf00i0
32013241
```
3242+
32023243
```json
32033244
{
32043245
"ids": [
@@ -3217,13 +3258,16 @@ curl -s -H "Accept: application/json" \
32173258
</summary>
32183259

32193260
### Description
3261+
32203262
The set of 100 parent inscription ids on `<PAGE>`.
32213263

32223264
### Example
3265+
32233266
```bash
32243267
curl -s -H "Accept: application/json" \
32253268
http://0.0.0.0:80/r/parents/b1ef66c2d1a047cbaa6260b74daac43813924378fe08ef8545da4cb79e8fcf00i0/9
32263269
```
3270+
32273271
```json
32283272
{
32293273
"ids": [],
@@ -3240,13 +3284,16 @@ curl -s -H "Accept: application/json" \
32403284
</summary>
32413285

32423286
### Description
3287+
32433288
The first 100 inscription ids on a sat. Requires index with `--index-sats` flag.
32443289

32453290
### Example
3291+
32463292
```bash
32473293
curl -s -H "Accept: application/json" \
32483294
http://0.0.0.0:80/r/sat/153899938226999
32493295
```
3296+
32503297
```json
32513298
{
32523299
"ids": [
@@ -3268,13 +3315,16 @@ curl -s -H "Accept: application/json" \
32683315
</summary>
32693316

32703317
### Description
3318+
32713319
The set of 100 inscription ids on `<PAGE>`. Requires index with `--index-sats` flag.
32723320

32733321
### Example
3322+
32743323
```bash
32753324
curl -s -H "Accept: application/json" \
32763325
http://0.0.0.0:80/r/sat/1499676120331756/1
32773326
```
3327+
32783328
```json
32793329
{
32803330
"ids": [
@@ -3303,13 +3353,16 @@ curl -s -H "Accept: application/json" \
33033353
</summary>
33043354

33053355
### Description
3356+
33063357
The inscription id at `<INDEX>` of all inscriptions on a sat. `<INDEX>` may be a negative number to index from the back. `0` being the first and `-1` being the most recent for example. Requires index with `--index-sats` flag.
33073358

33083359
### Example
3360+
33093361
```bash
33103362
curl -s -H "Accept: application/json" \
33113363
http://0.0.0.0:80/r/sat/153899938226999/at/-1
33123364
```
3365+
33133366
```json
33143367
{
33153368
"id": "488c32e4dfcdc0fa376c2c2af2d572a12f4d33d3245689d1a9f74167f1e14678i0"

src/api.rs

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ pub struct Output {
155155
pub address: Option<Address<NetworkUnchecked>>,
156156
pub indexed: bool,
157157
pub inscriptions: Vec<InscriptionId>,
158+
pub outpoint: OutPoint,
158159
pub runes: BTreeMap<SpacedRune, Pile>,
159160
pub sat_ranges: Option<Vec<(u64, u64)>>,
160161
pub script_pubkey: ScriptBuf,
@@ -181,6 +182,7 @@ impl Output {
181182
.map(|address| uncheck(&address)),
182183
indexed,
183184
inscriptions,
185+
outpoint,
184186
runes,
185187
sat_ranges,
186188
script_pubkey: tx_out.script_pubkey,

0 commit comments

Comments
 (0)