@@ -124,6 +124,8 @@ describe('/inscriptions', () => {
124
124
curse_type : null ,
125
125
recursive : false ,
126
126
recursion_refs : null ,
127
+ parent : null ,
128
+ metadata : null ,
127
129
} ;
128
130
129
131
// By inscription id
@@ -280,6 +282,8 @@ describe('/inscriptions', () => {
280
282
'f351d86c6e6cae3c64e297e7463095732f216875bcc1f3c03f950a492bb25421i0' ,
281
283
'b4b27b9a15f928b95a8ce4b418946553b7b313a345254cd9b23d79489175fa5ai0' ,
282
284
] ,
285
+ parent : null ,
286
+ metadata : null ,
283
287
} ;
284
288
285
289
// By inscription id
@@ -299,6 +303,127 @@ describe('/inscriptions', () => {
299
303
expect ( response2 . json ( ) ) . toStrictEqual ( expected ) ;
300
304
} ) ;
301
305
306
+ test ( 'shows inscription with parent' , async ( ) => {
307
+ await db . updateInscriptions (
308
+ new TestChainhookPayloadBuilder ( )
309
+ . apply ( )
310
+ . block ( {
311
+ height : 778575 ,
312
+ hash : '0x00000000000000000002a90330a99f67e3f01eb2ce070b45930581e82fb7a91d' ,
313
+ timestamp : 1676913207 ,
314
+ } )
315
+ . transaction ( {
316
+ hash : '0x9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201' ,
317
+ } )
318
+ . inscriptionRevealed ( {
319
+ content_bytes : `0x010101` ,
320
+ content_type : 'text/plain;charset=utf-8' ,
321
+ content_length : 5 ,
322
+ inscription_number : { classic : 0 , jubilee : 0 } ,
323
+ inscription_fee : 705 ,
324
+ inscription_id : '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201i0' ,
325
+ inscription_output_value : 10000 ,
326
+ inscriber_address : 'bc1pscktlmn99gyzlvymvrezh6vwd0l4kg06tg5rvssw0czg8873gz5sdkteqj' ,
327
+ ordinal_number : 257418248345364 ,
328
+ ordinal_block_height : 650000 ,
329
+ ordinal_offset : 0 ,
330
+ satpoint_post_inscription :
331
+ '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201:0:0' ,
332
+ tx_index : 0 ,
333
+ inscription_input_index : 0 ,
334
+ transfers_pre_inscription : 0 ,
335
+ curse_type : null ,
336
+ inscription_pointer : null ,
337
+ delegate : null ,
338
+ metaprotocol : null ,
339
+ metadata : null ,
340
+ parent : null ,
341
+ } )
342
+ . transaction ( {
343
+ hash : '0xf351d86c6e6cae3c64e297e7463095732f216875bcc1f3c03f950a492bb25421' ,
344
+ } )
345
+ . inscriptionRevealed ( {
346
+ content_bytes : '0x48656C6C6F' ,
347
+ content_type : 'image/png' ,
348
+ content_length : 5 ,
349
+ inscription_number : { classic : 1 , jubilee : 1 } ,
350
+ inscription_fee : 2805 ,
351
+ inscription_id : 'f351d86c6e6cae3c64e297e7463095732f216875bcc1f3c03f950a492bb25421i0' ,
352
+ inscription_output_value : 10000 ,
353
+ inscriber_address : 'bc1p3cyx5e2hgh53w7kpxcvm8s4kkega9gv5wfw7c4qxsvxl0u8x834qf0u2td' ,
354
+ ordinal_number : 257418248345364 ,
355
+ ordinal_block_height : 51483 ,
356
+ ordinal_offset : 0 ,
357
+ satpoint_post_inscription :
358
+ 'f351d86c6e6cae3c64e297e7463095732f216875bcc1f3c03f950a492bb25421:0:0' ,
359
+ inscription_input_index : 0 ,
360
+ transfers_pre_inscription : 0 ,
361
+ tx_index : 0 ,
362
+ curse_type : null ,
363
+ inscription_pointer : null ,
364
+ delegate : null ,
365
+ metaprotocol : null ,
366
+ metadata : null ,
367
+ parent : '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201i0' ,
368
+ } )
369
+ . build ( )
370
+ ) ;
371
+ const response = await fastify . inject ( {
372
+ method : 'GET' ,
373
+ url : '/ordinals/v1/inscriptions/f351d86c6e6cae3c64e297e7463095732f216875bcc1f3c03f950a492bb25421i0' ,
374
+ } ) ;
375
+ expect ( response . statusCode ) . toBe ( 200 ) ;
376
+ expect ( response . json ( ) . parent ) . toBe (
377
+ '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201i0'
378
+ ) ;
379
+ } ) ;
380
+
381
+ test ( 'shows inscription with metadata' , async ( ) => {
382
+ await db . updateInscriptions (
383
+ new TestChainhookPayloadBuilder ( )
384
+ . apply ( )
385
+ . block ( {
386
+ height : 778575 ,
387
+ hash : '0x00000000000000000002a90330a99f67e3f01eb2ce070b45930581e82fb7a91d' ,
388
+ timestamp : 1676913207 ,
389
+ } )
390
+ . transaction ( {
391
+ hash : '0x9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201' ,
392
+ } )
393
+ . inscriptionRevealed ( {
394
+ content_bytes : `0x010101` ,
395
+ content_type : 'text/plain;charset=utf-8' ,
396
+ content_length : 5 ,
397
+ inscription_number : { classic : 0 , jubilee : 0 } ,
398
+ inscription_fee : 705 ,
399
+ inscription_id : '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201i0' ,
400
+ inscription_output_value : 10000 ,
401
+ inscriber_address : 'bc1pscktlmn99gyzlvymvrezh6vwd0l4kg06tg5rvssw0czg8873gz5sdkteqj' ,
402
+ ordinal_number : 257418248345364 ,
403
+ ordinal_block_height : 650000 ,
404
+ ordinal_offset : 0 ,
405
+ satpoint_post_inscription :
406
+ '9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201:0:0' ,
407
+ tx_index : 0 ,
408
+ inscription_input_index : 0 ,
409
+ transfers_pre_inscription : 0 ,
410
+ curse_type : null ,
411
+ inscription_pointer : null ,
412
+ delegate : null ,
413
+ metaprotocol : null ,
414
+ metadata : { foo : 'bar' , test : 1337 } ,
415
+ parent : null ,
416
+ } )
417
+ . build ( )
418
+ ) ;
419
+ const response = await fastify . inject ( {
420
+ method : 'GET' ,
421
+ url : '/ordinals/v1/inscriptions/9f4a9b73b0713c5da01c0a47f97c6c001af9028d6bdd9e264dfacbc4e6790201i0' ,
422
+ } ) ;
423
+ expect ( response . statusCode ) . toBe ( 200 ) ;
424
+ expect ( response . json ( ) . metadata ) . toStrictEqual ( { foo : 'bar' , test : 1337 } ) ;
425
+ } ) ;
426
+
302
427
test ( 'shows inscription with empty genesis address' , async ( ) => {
303
428
await db . updateInscriptions (
304
429
new TestChainhookPayloadBuilder ( )
@@ -362,6 +487,8 @@ describe('/inscriptions', () => {
362
487
curse_type : null ,
363
488
recursive : false ,
364
489
recursion_refs : null ,
490
+ parent : null ,
491
+ metadata : null ,
365
492
} ;
366
493
367
494
// By inscription id
@@ -444,6 +571,8 @@ describe('/inscriptions', () => {
444
571
curse_type : '88' ,
445
572
recursive : false ,
446
573
recursion_refs : null ,
574
+ parent : null ,
575
+ metadata : null ,
447
576
} ;
448
577
449
578
// By inscription id
@@ -555,6 +684,8 @@ describe('/inscriptions', () => {
555
684
curse_type : null ,
556
685
recursive : false ,
557
686
recursion_refs : null ,
687
+ parent : null ,
688
+ metadata : null ,
558
689
} ) ;
559
690
560
691
// Transfer 2
@@ -610,6 +741,8 @@ describe('/inscriptions', () => {
610
741
curse_type : null ,
611
742
recursive : false ,
612
743
recursion_refs : null ,
744
+ parent : null ,
745
+ metadata : null ,
613
746
} ) ;
614
747
} ) ;
615
748
@@ -720,6 +853,8 @@ describe('/inscriptions', () => {
720
853
curse_type : null ,
721
854
recursive : false ,
722
855
recursion_refs : null ,
856
+ parent : null ,
857
+ metadata : null ,
723
858
} ) ;
724
859
} ) ;
725
860
@@ -815,6 +950,8 @@ describe('/inscriptions', () => {
815
950
curse_type : '{"tag":66}' ,
816
951
recursive : false ,
817
952
recursion_refs : null ,
953
+ parent : null ,
954
+ metadata : null ,
818
955
} ) ;
819
956
820
957
// Transfer 2
@@ -870,6 +1007,8 @@ describe('/inscriptions', () => {
870
1007
curse_type : '{"tag":66}' ,
871
1008
recursive : false ,
872
1009
recursion_refs : null ,
1010
+ parent : null ,
1011
+ metadata : null ,
873
1012
} ) ;
874
1013
} ) ;
875
1014
} ) ;
@@ -1515,6 +1654,8 @@ describe('/inscriptions', () => {
1515
1654
curse_type : null ,
1516
1655
recursive : false ,
1517
1656
recursion_refs : null ,
1657
+ parent : null ,
1658
+ metadata : null ,
1518
1659
} ,
1519
1660
{
1520
1661
address : 'bc1pscktlmn99gyzlvymvrezh6vwd0l4kg06tg5rvssw0czg8873gz5sdkteqj' ,
@@ -1541,6 +1682,8 @@ describe('/inscriptions', () => {
1541
1682
curse_type : null ,
1542
1683
recursive : false ,
1543
1684
recursion_refs : null ,
1685
+ parent : null ,
1686
+ metadata : null ,
1544
1687
} ,
1545
1688
] ) ;
1546
1689
} ) ;
@@ -1654,6 +1797,8 @@ describe('/inscriptions', () => {
1654
1797
curse_type : null ,
1655
1798
recursive : false ,
1656
1799
recursion_refs : null ,
1800
+ parent : null ,
1801
+ metadata : null ,
1657
1802
} ;
1658
1803
expect ( responseJson1 . results [ 0 ] ) . toStrictEqual ( result1 ) ;
1659
1804
@@ -1689,6 +1834,8 @@ describe('/inscriptions', () => {
1689
1834
curse_type : null ,
1690
1835
recursive : false ,
1691
1836
recursion_refs : null ,
1837
+ parent : null ,
1838
+ metadata : null ,
1692
1839
} ;
1693
1840
expect ( responseJson2 . results [ 0 ] ) . toStrictEqual ( result2 ) ;
1694
1841
0 commit comments