blokli-client 0.33.1

Client connector to Blokli
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
"""
Account information

The Account type contains identity information for HOPR nodes including keys,
addresses, and network announcements. To query balances and allowances, use the
dedicated balance and allowance queries (hoprBalance, nativeBalance, safeHoprAllowance).
"""
type Account {
	"""
	Unique identifier for the account
	"""
	keyid: Int!
	"""
	Unique account on-chain address in hexadecimal format
	"""
	chainKey: String!
	"""
	Unique account packet key in peer id format
	"""
	packetKey: String!
	"""
	HOPR Safe contract address to which the account is linked
	"""
	safeAddress: String
	"""
	Latest announced multiaddress for the packet key, returned as an empty or single-element list
	"""
	multiAddresses: [String!]!
}

"""
Success response for accounts list query
"""
type AccountsList {
	"""
	List of accounts
	"""
	accounts: [Account!]!
}

"""
Result type for accounts list query
"""
union AccountsResult = AccountsList | MissingFilterError | QueryFailedError

"""
Result type for module address calculation
"""
union CalculateModuleAddressResult = ModuleAddress | InvalidAddressError | QueryFailedError

"""
Blockchain and HOPR network information
"""
type ChainInfo {
	"""
	Current block number of the blockchain
	"""
	blockNumber: Int!
	"""
	Chain ID of the connected blockchain network
	"""
	chainId: Int!
	"""
	Network name (e.g., 'rotsee', 'jura')
	"""
	network: String!
	"""
	Current HOPR token price
	"""
	ticketPrice: TokenValueString!
	"""
	Current key binding fee
	"""
	keyBindingFee: TokenValueString!
	"""
	Estimated legacy gas price in wei from RPC
	"""
	gasPrice: String
	"""
	Estimated EIP-1559 max fee per gas in wei from RPC, scaled by api.gas_multiplier
	"""
	maxFeePerGas: String
	"""
	Estimated EIP-1559 max priority fee per gas in wei from RPC, scaled by api.gas_multiplier
	"""
	maxPriorityFeePerGas: String
	"""
	Current minimum ticket winning probability (decimal value between 0.0 and 1.0)
	"""
	minTicketWinningProbability: Float!
	"""
	Channel smart contract domain separator (hex string)
	"""
	channelDst: String
	"""
	Map of contract identifiers to their deployed addresses
	"""
	contractAddresses: ContractAddressMap!
	"""
	Ledger smart contract domain separator (hex string)
	"""
	ledgerDst: String
	"""
	Safe Registry smart contract domain separator (hex string)
	"""
	safeRegistryDst: String
	"""
	Channel closure grace period in seconds
	"""
	channelClosureGracePeriod: UInt64!
	"""
	Expected block time in seconds
	"""
	expectedBlockTime: UInt64!
	"""
	Number of block confirmations required for finality
	"""
	finality: UInt64!
}

"""
Result type for chain info queries
"""
union ChainInfoResult = ChainInfo | QueryFailedError

"""
Payment channel between two nodes
"""
type Channel {
	"""
	Unique identifier for the payment channel in hexadecimal format
	"""
	concreteChannelId: String!
	"""
	Account keyid of the source node
	"""
	source: Int!
	"""
	Account keyid of the destination node
	"""
	destination: Int!
	"""
	Total amount of HOPR tokens allocated to the channel
	"""
	balance: TokenValueString!
	"""
	Current state of the channel (OPEN, PENDINGTOCLOSE, or CLOSED)
	"""
	status: ChannelStatus!
	"""
	Current epoch of the channel (uint24)
	"""
	epoch: Int!
	"""
	Latest ticket index used in the channel (uint48, max: 281474976710655)
	"""
	ticketIndex: UInt64!
	"""
	Timestamp when the channel closure was initiated (null if no closure initiated)
	"""
	closureTime: DateTime
}

"""
Aggregated channel statistics: count and total balance
"""
type ChannelStats {
	"""
	Number of channels matching the filters
	"""
	count: Int!
	"""
	Total wxHOPR balance across all matching channels
	"""
	balance: TokenValueString!
}

"""
Result type for channel statistics query
"""
union ChannelStatsResult = ChannelStats | InvalidAddressError | QueryFailedError

"""
Status of a payment channel
"""
enum ChannelStatus {
	"""
	Channel is open and operational
	"""
	OPEN
	"""
	Channel is in the process of closing
	"""
	PENDINGTOCLOSE
	"""
	Channel has been closed
	"""
	CLOSED
}

"""
Success response for channels list query
"""
type ChannelsList {
	"""
	List of channels
	"""
	channels: [Channel!]!
}

"""
Result type for channels list query
"""
union ChannelsResult = ChannelsList | InvalidAddressError | MissingFilterError | QueryFailedError

"""
Response for the legacy `compatibility` query.
"""
type Compatibility {
	"""
	Server version (semver).
	"""
	apiVersion: String!
	"""
	Semver range of compatible client versions. Always `"*"` — any client is accepted.
	"""
	supportedClientVersions: String!
	"""
	Feature flags advertised by this server. Always empty since versioning is now header-based.
	"""
	features: [String!]!
}

scalar ContractAddressMap

"""
Target contract not in allowlist
"""
type ContractNotAllowedError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
	"""
	Contract address that was rejected
	"""
	contractAddress: String!
}

"""
Count value for count queries
"""
type Count {
	"""
	Count value
	"""
	count: Int!
}

"""
Result type for count queries
"""
union CountResult = Count | MissingFilterError | QueryFailedError

"""
Address returned by a Curvy portal lookup.
"""
type CurvyAddress {
	"""
	Curvy portal address in hexadecimal format.
	"""
	address: String!
}

"""
Curvy Aggregator fee configuration needed to build a valid aggregation proof.
"""
type CurvyAggregatorFees {
	"""
	Protocol fee charged per thousand units.
	"""
	protocolFeePerThousand: UInt256!
	"""
	Root of the commitment gas-fee tree.
	"""
	commitmentFeeRoot: Hex32!
	"""
	Baby Jubjub public key that owns protocol fee notes.
	"""
	feeNotePublicKey: [UInt256!]!
}

"""
Result type for the Curvy Aggregator fee query.
"""
union CurvyAggregatorFeesResult = CurvyAggregatorFees | QueryFailedError

"""
Current Curvy Aggregator indices and notes-tree root.
"""
type CurvyAggregatorState {
	"""
	Current notes-tree root.
	"""
	notesTreeRoot: Hex32!
	"""
	Current committed-notes batch index.
	"""
	notesBatchIndex: UInt256!
	"""
	Current committed-nullifiers batch index.
	"""
	nullifiersBatchIndex: UInt256!
	"""
	Number of non-padding notes committed to the notes tree.
	"""
	noteIndex: UInt256!
}

"""
Result type for the Curvy Aggregator state query.
"""
union CurvyAggregatorStateResult = CurvyAggregatorState | QueryFailedError

"""
Boolean value returned by Curvy contract checks.
"""
type CurvyBooleanValue {
	"""
	Result of the contract check.
	"""
	value: Boolean!
}

"""
One note emitted by `CommittedNotes`.
"""
type CurvyCommittedNote {
	"""
	Commitment batch index as a fixed-width 32-byte value.
	"""
	batchIndex: Hex32!
	"""
	Committed note identifier.
	"""
	noteId: Hex32!
	"""
	Dense zero-based position in the notes tree.
	"""
	leafIndex: UInt64!
	"""
	Chain position of the array item that emitted this note.
	"""
	position: CurvyEventPosition!
}

"""
Collection of indexed Curvy committed notes.
"""
type CurvyCommittedNotes {
	"""
	Committed notes ordered by chain position.
	"""
	notes: [CurvyCommittedNote!]!
}

"""
Result type for the indexed Curvy committed-notes query.
"""
union CurvyCommittedNotesResult = CurvyCommittedNotes | QueryFailedError

"""
One nullifier emitted by `CommittedNullifiers`.
"""
type CurvyCommittedNullifier {
	"""
	Nullifier batch index as a fixed-width 32-byte value.
	"""
	batchIndex: Hex32!
	"""
	Committed nullifier value.
	"""
	nullifier: Hex32!
	"""
	Dense zero-based position in the nullifier sequence.
	"""
	nullifierIndex: UInt64!
	"""
	Chain position of the array item that emitted this nullifier.
	"""
	position: CurvyEventPosition!
}

"""
Collection of indexed Curvy committed nullifiers.
"""
type CurvyCommittedNullifiers {
	"""
	Committed nullifiers ordered by chain position.
	"""
	nullifiers: [CurvyCommittedNullifier!]!
}

"""
Result type for the indexed Curvy committed-nullifiers query.
"""
union CurvyCommittedNullifiersResult = CurvyCommittedNullifiers | QueryFailedError

"""
Result type for a derived Curvy entry portal address.
"""
union CurvyEntryPortalAddressResult = CurvyAddress | InvalidAddressError | QueryFailedError

"""
Exclusive pagination cursor for indexed Curvy events.
"""
input CurvyEventCursor {
	"""
	Block number containing the event.
	"""
	block: UInt64!
	"""
	Zero-based transaction index inside the block.
	"""
	transactionIndex: UInt64!
	"""
	Zero-based log index inside the transaction receipt.
	"""
	logIndex: UInt64!
	"""
	Zero-based position of the item inside the event array.
	"""
	eventItemIndex: UInt64!
	"""
	Hash of the block containing the event, when known.
	"""
	blockHash: Hex32
}

"""
Position and transaction identity shared by indexed Curvy events.
"""
type CurvyEventPosition {
	"""
	Hash of the transaction that emitted the event.
	"""
	transactionHash: Hex32!
	"""
	Hash of the block containing the event.
	"""
	blockHash: Hex32!
	"""
	Block number containing the event.
	"""
	block: UInt64!
	"""
	Zero-based transaction index inside the block.
	"""
	transactionIndex: UInt64!
	"""
	Zero-based log index inside the transaction receipt.
	"""
	logIndex: UInt64!
	"""
	Zero-based position of the item inside the event array.
	"""
	eventItemIndex: UInt64!
}

"""
Result type for a derived Curvy exit portal address.
"""
union CurvyExitPortalAddressResult = CurvyAddress | InvalidAddressError | QueryFailedError

"""
Current per-token gas fees read from the Curvy Vault.
"""
type CurvyGasFees {
	"""
	Identifier of the configured vault token.
	"""
	tokenId: UInt256!
	"""
	Gas fee charged when deploying a portal.
	"""
	portalDeployment: UInt256!
	"""
	Gas fee charged when committing a pending note.
	"""
	pendingNoteCommitment: UInt256!
	"""
	Gas fee charged when withdrawing a note.
	"""
	withdrawal: UInt256!
}

"""
Raw status of a Curvy note.
"""
type CurvyNoteStatus {
	"""
	Numeric `NoteStatus` value returned by the Aggregator.
	"""
	status: Int!
}

"""
Result type for the Curvy note-status query.
"""
union CurvyNoteStatusResult = CurvyNoteStatus | QueryFailedError

"""
Result type for the Curvy nullifier-spent check.
"""
union CurvyNullifierSpentResult = CurvyBooleanValue | QueryFailedError

"""
One note emitted by `PendingNotes`.
"""
type CurvyPendingNote {
	"""
	Pending note identifier.
	"""
	noteId: Hex32!
	"""
	Baby Jubjub ephemeral public key coordinates.
	"""
	ephemeralKey: [UInt256!]!
	"""
	View tag used for local ownership detection.
	"""
	viewTag: Int!
	"""
	Vault token identifier.
	"""
	tokenId: UInt256!
	"""
	Raw note amount.
	"""
	amount: UInt256!
	"""
	Whether the note payload is plaintext.
	"""
	isPlaintext: Boolean!
	"""
	Chain position of the array item that emitted this note.
	"""
	position: CurvyEventPosition!
}

"""
Collection of indexed Curvy pending notes.
"""
type CurvyPendingNotes {
	"""
	Pending notes ordered by chain position.
	"""
	notes: [CurvyPendingNote!]!
}

"""
Result type for the indexed Curvy pending-notes query.
"""
union CurvyPendingNotesResult = CurvyPendingNotes | QueryFailedError

"""
Result type for the Curvy portal-registration check.
"""
union CurvyPortalRegisteredResult = CurvyBooleanValue | InvalidAddressError | QueryFailedError

"""
One completed Curvy notes-tree shard.
"""
type CurvyShardRoot {
	"""
	Dense zero-based shard index.
	"""
	shardIndex: UInt64!
	"""
	Root of the completed shard.
	"""
	root: Hex32!
	"""
	Chain position at which the shard became complete.
	"""
	completionPosition: CurvyEventPosition!
}

"""
Checkpoint-pinned page of completed Curvy shard roots.
"""
type CurvyShardRootPage {
	"""
	Block hash identifying the synchronization checkpoint.
	"""
	checkpoint: Hex32!
	"""
	Completed shard roots in this page.
	"""
	shardRoots: [CurvyShardRoot!]!
	"""
	Dense index from which the next page starts.
	"""
	nextIndex: UInt64!
	"""
	Total number of completed shards at the checkpoint.
	"""
	total: UInt64!
}

"""
Result type for the checkpoint-pinned Curvy shard-root query.
"""
union CurvyShardRootsResult = CurvyShardRootPage | QueryFailedError

"""
Finalized, immutable Curvy synchronization checkpoint.
"""
type CurvySyncCheckpoint {
	"""
	Number of the finalized checkpoint block.
	"""
	blockNumber: UInt64!
	"""
	Hash of the finalized checkpoint block.
	"""
	blockHash: Hex32!
	"""
	Address of the indexed Curvy Aggregator.
	"""
	aggregatorAddress: String!
	"""
	Version of the persisted notes-tree representation.
	"""
	treeVersion: Int!
	"""
	Depth of the Curvy notes tree.
	"""
	treeDepth: Int!
	"""
	Height of each persisted notes-tree shard.
	"""
	shardHeight: Int!
	"""
	Number of leaves in each notes-tree shard.
	"""
	shardSize: UInt64!
	"""
	Number of indexed non-padding notes.
	"""
	noteCount: UInt64!
	"""
	Number of indexed non-padding nullifiers.
	"""
	nullifierCount: UInt64!
	"""
	Number of completed notes-tree shards.
	"""
	shardCount: UInt64!
	"""
	Notes-tree root at the checkpoint.
	"""
	notesRoot: Hex32!
}

"""
Result type for the Curvy synchronization-checkpoint query.
"""
union CurvySyncCheckpointResult = CurvySyncCheckpoint | QueryFailedError

"""
Committed note plus its optional announcement metadata for SDK synchronization.
"""
type CurvySyncNote {
	"""
	Dense zero-based position in the notes tree.
	"""
	leafIndex: UInt64!
	"""
	Committed note identifier.
	"""
	noteId: Hex32!
	"""
	Commitment batch index.
	"""
	batchIndex: Hex32!
	"""
	Matching pending-note announcement, when indexed.
	"""
	announcement: CurvyPendingNote
	"""
	Chain position at which the note was committed.
	"""
	commitPosition: CurvyEventPosition!
}

"""
Checkpoint-pinned page of dense Curvy committed notes.
"""
type CurvySyncNotePage {
	"""
	Block hash identifying the synchronization checkpoint.
	"""
	checkpoint: Hex32!
	"""
	Committed notes in this page.
	"""
	notes: [CurvySyncNote!]!
	"""
	Dense index from which the next page starts.
	"""
	nextIndex: UInt64!
	"""
	Total number of notes at the checkpoint.
	"""
	total: UInt64!
}

"""
Result type for the checkpoint-pinned Curvy notes query.
"""
union CurvySyncNotesResult = CurvySyncNotePage | QueryFailedError

"""
Checkpoint-pinned page of dense Curvy nullifiers.
"""
type CurvySyncNullifierPage {
	"""
	Block hash identifying the synchronization checkpoint.
	"""
	checkpoint: Hex32!
	"""
	Committed nullifiers in this page.
	"""
	nullifiers: [CurvyCommittedNullifier!]!
	"""
	Dense index from which the next page starts.
	"""
	nextIndex: UInt64!
	"""
	Total number of nullifiers at the checkpoint.
	"""
	total: UInt64!
}

"""
Result type for the checkpoint-pinned Curvy nullifiers query.
"""
union CurvySyncNullifiersResult = CurvySyncNullifierPage | QueryFailedError

"""
Result type for the Curvy valid-notes-root check.
"""
union CurvyValidNotesRootResult = CurvyBooleanValue | QueryFailedError

"""
Current Curvy Vault protocol-level fees.
"""
type CurvyVaultFees {
	"""
	Protocol fee charged on deposits.
	"""
	depositFee: UInt256!
	"""
	Protocol fee charged on withdrawals.
	"""
	withdrawalFee: UInt256!
}

"""
Result type for the Curvy Vault fee query.
"""
union CurvyVaultFeesResult = CurvyVaultFees | QueryFailedError

"""
A Curvy Vault token and its configured gas fees.
"""
type CurvyVaultToken {
	"""
	ERC-20 token contract address.
	"""
	tokenAddress: String!
	"""
	Gas fees configured for the token.
	"""
	gasFees: CurvyGasFees!
}

"""
The number of tokens registered in the Curvy Vault.
"""
type CurvyVaultTokenCount {
	"""
	Number of registered vault tokens.
	"""
	count: UInt256!
}

"""
Result type for the Curvy Vault token-count query.
"""
union CurvyVaultTokenCountResult = CurvyVaultTokenCount | QueryFailedError

"""
Result type for a Curvy Vault token query.
"""
union CurvyVaultTokenResult = CurvyVaultToken | QueryFailedError

"""
Implement the DateTime<Utc> scalar

The input/output is a string in RFC3339 format.
"""
scalar DateTime

"""
Function selector not allowed
"""
type FunctionNotAllowedError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
	"""
	Contract address
	"""
	contractAddress: String!
	"""
	Function selector that was rejected
	"""
	functionSelector: String!
}

scalar Hex32

"""
HOPR token balance information for a specific address
"""
type HoprBalance {
	"""
	Address holding the HOPR token balance
	"""
	address: String!
	"""
	HOPR token balance
	"""
	balance: TokenValueString!
}

"""
Result type for HOPR balance queries
"""
union HoprBalanceResult = HoprBalance | InvalidAddressError | QueryFailedError

"""
Address format is invalid
"""
type InvalidAddressError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
	"""
	The invalid address that was provided
	"""
	address: String!
}

"""
Transaction ID format is invalid
"""
type InvalidTransactionIdError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
	"""
	The invalid transaction ID that was provided
	"""
	transactionId: String!
}

"""
Missing required filter parameter error
"""
type MissingFilterError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
}

"""
Calculated module address
"""
type ModuleAddress {
	"""
	Predicted module address (hexadecimal format)
	"""
	moduleAddress: String!
}

type MutationRoot {
	"""
	Submit a transaction with fire-and-forget mode

	Validates the pre-signed raw transaction data and submits it to the chain.
	Returns the transaction hash immediately after submission.
	Does not wait for confirmation and does not track transaction status.
	Use this mode for maximum performance when you don't need confirmation tracking.
	"""
	sendTransaction(input: TransactionInput!): SendTransactionResult!
	"""
	Submit a transaction asynchronously

	Validates the pre-signed raw transaction data and submits it to the chain immediately.
	Returns the transaction ID that can be used to query status later.
	Does not wait for on-chain confirmation. Background monitor tracks confirmation.
	"""
	sendTransactionAsync(input: TransactionInput!): SendTransactionAsyncResult!
	"""
	Submit a transaction synchronously

	Validates the pre-signed raw transaction data, submits it to the chain, and waits for
	the specified number of confirmations (default: 3 blocks) before returning.
	Transaction is persisted to store and can be queried later.
	"""
	sendTransactionSync(input: TransactionInput!, confirmations: Int): SendTransactionSyncResult!
}

"""
Native token balance information for a specific address
"""
type NativeBalance {
	"""
	Address holding the native token balance
	"""
	address: String!
	"""
	Native token balance
	"""
	balance: TokenValueString!
}

"""
Result type for native balance queries
"""
union NativeBalanceResult = NativeBalance | InvalidAddressError | QueryFailedError

"""
A single edge in the opened payment channels graph

Represents one channel with its associated source and destination accounts.
This is a directed edge: source → destination. If channels exist in both
directions (A→B and B→A), these are emitted as separate entries.

**Structure:**
- Each entry contains exactly one channel with its source and destination accounts
- If multiple channels exist between the same account pair, each is emitted as a separate entry
- The channel is always open (closed channels are not included)

**Usage in subscriptions:**
The `openedChannelGraphUpdated` subscription streams these entries one at a time.
Clients must accumulate entries to build the complete channel graph.
An entry is emitted whenever that specific channel is updated.
"""
type OpenedChannelsGraphEntry {
	"""
	The open payment channel from source to destination
	"""
	channel: Channel!
	"""
	Source account (sender end of the directed edge)
	"""
	source: Account!
	"""
	Destination account (recipient end of the directed edge)
	"""
	destination: Account!
}

"""
Database or internal query error
"""
type QueryFailedError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
}

type QueryRoot {
	"""
	Retrieve Curvy notes emitted by `PendingNotes`, ordered by chain position.
	"""
	curvyPendingNotes(
		"""
		Earliest block number to include
		"""
		fromBlock: UInt64,
		"""
		Exclusive event cursor after which results start
		"""
		after: CurvyEventCursor,
		"""
		Maximum number of notes to return
		"""
		first: Int
	): CurvyPendingNotesResult!
	"""
	Retrieve Curvy notes emitted by `CommittedNotes`, ordered by chain position.
	"""
	curvyCommittedNotes(
		"""
		Earliest block number to include
		"""
		fromBlock: UInt64,
		"""
		Exclusive event cursor after which results start
		"""
		after: CurvyEventCursor,
		"""
		Maximum number of notes to return
		"""
		first: Int
	): CurvyCommittedNotesResult!
	"""
	Retrieve Curvy nullifiers emitted by `CommittedNullifiers`.
	"""
	curvyCommittedNullifiers(
		"""
		Earliest block number to include
		"""
		fromBlock: UInt64,
		"""
		Exclusive event cursor after which results start
		"""
		after: CurvyEventCursor,
		"""
		Maximum number of nullifiers to return
		"""
		first: Int
	): CurvyCommittedNullifiersResult!
	"""
	Retrieve the latest Curvy synchronization checkpoint or one pinned by block hash.
	"""
	curvySyncCheckpoint(
		"""
		Finalized block hash to pin, or null for the latest checkpoint
		"""
		blockHash: Hex32
	): CurvySyncCheckpointResult!
	"""
	Retrieve checkpoint-pinned committed notes by dense leaf index.
	"""
	curvySyncNotes(
		"""
		Block hash identifying the synchronization checkpoint
		"""
		checkpoint: Hex32!,
		"""
		Dense leaf index from which results start
		"""
		fromIndex: UInt64,
		"""
		Maximum number of notes to return
		"""
		first: Int
	): CurvySyncNotesResult!
	"""
	Retrieve checkpoint-pinned nullifiers by dense nullifier index.
	"""
	curvySyncNullifiers(
		"""
		Block hash identifying the synchronization checkpoint
		"""
		checkpoint: Hex32!,
		"""
		Dense nullifier index from which results start
		"""
		fromIndex: UInt64,
		"""
		Maximum number of nullifiers to return
		"""
		first: Int
	): CurvySyncNullifiersResult!
	"""
	Retrieve checkpoint-pinned completed notes-tree shard roots.
	"""
	curvyShardRoots(
		"""
		Block hash identifying the synchronization checkpoint
		"""
		checkpoint: Hex32!,
		"""
		Dense shard index from which results start
		"""
		fromIndex: UInt64,
		"""
		Maximum number of shard roots to return
		"""
		first: Int
	): CurvyShardRootsResult!
	"""
	Read the current Curvy Aggregator root and indices directly from chain.
	"""
	curvyAggregatorState: CurvyAggregatorStateResult!
	"""
	Read a Curvy note's raw `NoteStatus` value directly from chain.
	"""
	curvyNoteStatus(
		"""
		Identifier of the note to inspect
		"""
		noteId: Hex32!
	): CurvyNoteStatusResult!
	"""
	Check whether a notes root is valid in the Curvy Aggregator.
	"""
	curvyValidNotesRoot(
		"""
		Notes-tree root to validate
		"""
		root: Hex32!
	): CurvyValidNotesRootResult!
	"""
	Check whether a nullifier is already present in the Curvy Aggregator.
	"""
	curvyNullifierSpent(
		"""
		Nullifier value to inspect
		"""
		nullifier: Hex32!
	): CurvyNullifierSpentResult!
	"""
	Read the Curvy Vault deposit and withdrawal fees directly from chain.
	"""
	curvyVaultFees: CurvyVaultFeesResult!
	"""
	Read the Curvy Aggregator fee configuration directly from chain.

	The protocol fee rate, the commitment gas-fee tree root, and the fee-note
	public key are all required to build a valid aggregation proof: the circuit
	constrains the fee note's owner to `feeNotePublicKey` and its amount to
	`gasFee + protocolFeeQ`.
	"""
	curvyAggregatorFees: CurvyAggregatorFeesResult!
	"""
	Read how many tokens are registered in the Curvy Vault, so a client can
	enumerate `curvyVaultToken` over the real set instead of probing ids.
	"""
	curvyVaultTokenCount: CurvyVaultTokenCountResult!
	"""
	Read a Curvy Vault token address and per-token gas fees directly from chain.
	"""
	curvyVaultToken(
		"""
		Identifier of the vault token to read
		"""
		tokenId: UInt256!
	): CurvyVaultTokenResult!
	"""
	Derive a Curvy entry portal address directly from PortalFactory.
	"""
	curvyEntryPortalAddress(
		"""
		Hash of the entry portal owner identity
		"""
		ownerHash: UInt256!,
		"""
		Recovery address configured for the portal
		"""
		recovery: String!
	): CurvyEntryPortalAddressResult!
	"""
	Derive a Curvy exit portal address directly from PortalFactory.
	"""
	curvyExitPortalAddress(
		"""
		Exit owner address configured for the portal
		"""
		exitAddress: String!,
		"""
		Chain identifier on which the exit operates
		"""
		exitChainId: UInt256!,
		"""
		Recovery address configured for the portal
		"""
		recovery: String!
	): CurvyExitPortalAddressResult!
	"""
	Check whether an address is registered with Curvy PortalFactory.
	"""
	curvyPortalRegistered(
		"""
		Portal address to inspect
		"""
		portalAddress: String!
	): CurvyPortalRegisteredResult!
	"""
	Retrieve accounts from the database with required filtering

	At least one filter parameter must be provided (keyid, packet_key, or chain_key).
	Returns a union type indicating success or specific error conditions.
	Filters can be combined to narrow results.
	"""
	accounts(
		"""
		Filter by account keyid
		"""
		keyid: Int,
		"""
		Filter by packet key (peer ID format)
		"""
		packetKey: String,
		"""
		Filter by chain key (hexadecimal format)
		"""
		chainKey: String
	): AccountsResult!
	"""
	Count accounts matching optional filters

	If no filters are provided, returns total account count.
	Filters can be combined to narrow results.
	"""
	accountCount(
		"""
		Filter by account keyid
		"""
		keyid: Int,
		"""
		Filter by packet key (peer ID format)
		"""
		packetKey: String,
		"""
		Filter by chain key (hexadecimal format)
		"""
		chainKey: String
	): CountResult!
	"""
	Count channels matching optional filters

	If no filters are provided, returns total channels count.
	Filters can be combined to narrow results.
	"""
	channelCount(
		"""
		Filter by source node keyid
		"""
		sourceKeyId: Int,
		"""
		Filter by destination node keyid
		"""
		destinationKeyId: Int,
		"""
		Filter by concrete channel ID (hexadecimal format)
		"""
		concreteChannelId: String,
		"""
		Filter by safe address — restricts to channels where the source belongs to this safe (hexadecimal format)
		"""
		safeAddress: String,
		"""
		Filter by channel status (optional, combine with identity filters)
		"""
		status: ChannelStatus
	): CountResult! @deprecated(reason: "Use channelStats instead, which also returns the total wxHOPR balance.")
	"""
	Retrieve count and total wxHOPR balance for channels matching optional filters

	If no filters are provided, returns stats across all channels.
	The safe_address filter restricts results to channels where the source account
	is associated with the given safe contract.
	Filters can be combined to narrow results.
	"""
	channelStats(
		"""
		Filter by source node keyid
		"""
		sourceKeyId: Int,
		"""
		Filter by destination node keyid
		"""
		destinationKeyId: Int,
		"""
		Filter by concrete channel ID (hexadecimal format)
		"""
		concreteChannelId: String,
		"""
		Filter by safe address — restricts to channels where the source belongs to this safe (hexadecimal format)
		"""
		safeAddress: String,
		"""
		Filter by channel status
		"""
		status: ChannelStatus
	): ChannelStatsResult!
	"""
	Retrieve channels with required filtering

	At least one identity-based filter must be provided (source_key_id, destination_key_id,
	concrete_channel_id, or safe_address). The status filter is optional and can be combined
	with others. The safe_address filter restricts results to channels where the source account
	is associated with the given safe contract.
	Returns the list of matching channels.
	"""
	channels(
		"""
		Filter by source node keyid
		"""
		sourceKeyId: Int,
		"""
		Filter by destination node keyid
		"""
		destinationKeyId: Int,
		"""
		Filter by concrete channel ID (hexadecimal format)
		"""
		concreteChannelId: String,
		"""
		Filter by channel status (optional, combine with identity filters)
		"""
		status: ChannelStatus,
		"""
		Filter by safe address — restricts to channels where the source belongs to this safe (hexadecimal format)
		"""
		safeAddress: String
	): ChannelsResult!
	"""
	Retrieve HOPR token balance for a specific address

	This query makes a direct RPC call to the blockchain to get a current HOPR token balance.
	No database storage is used - balance is fetched directly from the chain.
	"""
	hoprBalance(
		"""
		On-chain address to query (hexadecimal format)
		"""
		address: String!,
		"""
		Token type to query (defaults to wxHOPR)
		"""
		token: Token
	): HoprBalanceResult!
	"""
	Retrieve native token balance for a specific address

	This query makes a direct RPC call to the blockchain to get the current native token (xDAI) balance.
	No database storage is used - balance is fetched directly from the chain.
	"""
	nativeBalance(
		"""
		On-chain address to query (hexadecimal format)
		"""
		address: String!
	): NativeBalanceResult!
	"""
	Retrieve Safe HOPR token allowance for a specific Safe address

	Returns the wxHOPR token allowance that the specified Safe contract has granted
	to the HOPR channels contract.

	This query makes a direct RPC call to the blockchain to get the current allowance.
	No database storage is used - allowance is fetched directly from the chain.
	"""
	safeHoprAllowance(
		"""
		Safe contract address to query (hexadecimal format)
		"""
		address: String!
	): SafeHoprAllowanceResult!
	"""
	Retrieve aggregated TicketRedeemed statistics filtered by safe, node, or both.

	At least one filter field must be provided. If both are provided, both filters are applied.
	"""
	ticketRedemptionStats(
		"""
		Filter specifying which safe/node combination to aggregate
		"""
		filter: RedeemedStatsFilter!
	): RedeemedStatsResult!
	"""
	Fetches the transaction count for any Ethereum address (EOA or contract).

	The `address` must be a hexadecimal Ethereum address. The resolver validates the address format,
	queries the blockchain RPC for the transaction count with smart detection, and returns a
	`TransactionCountResult` that indicates success, an invalid address error, or a query failure.

	This method supports multiple address types:
	- **EOAs (Externally Owned Accounts)**: Returns the transaction count via `eth_getTransactionCount`
	- **Safe contracts**: Returns the Safe's internal nonce via `nonce()` function
	- **Other contracts**: Attempts `nonce()` call, falls back to `eth_getTransactionCount`

	# Returns

	- `TransactionCountResult::TransactionCount` containing the queried `address` and the `count` on success.
	- `TransactionCountResult::InvalidAddress` if the provided address is not a valid hexadecimal Ethereum address.
	- `TransactionCountResult::QueryFailed` if the RPC call fails.

	# Examples

	```ignore
	# use api::query::TransactionCountResult;
	# use api::query::TransactionCount;
	# use api::query::UInt64;
	// Suppose `res` is the value returned by `transaction_count`.
	let res: TransactionCountResult = TransactionCountResult::TransactionCount(TransactionCount {
	address: "0x0000000000000000000000000000000000000000".to_string(),
	count: UInt64(42),
	});

	match res {
	TransactionCountResult::TransactionCount(tc) => {
	assert_eq!(tc.count.0, 42);
	assert_eq!(tc.address, "0x0000000000000000000000000000000000000000");
	}
	TransactionCountResult::InvalidAddress(err) => panic!("invalid address: {}", err.message),
	TransactionCountResult::QueryFailed(err) => panic!("query failed: {}", err.message),
	}
	```
	"""
	transactionCount(
		"""
		Address to query (hexadecimal format) - supports EOAs and contracts
		"""
		address: String!
	): TransactionCountResult!
	safeBy(
		"""
		Selector type for safe lookup
		"""
		selector: SafeSelectorInput!,
		"""
		Address value for the selector (hexadecimal format)
		"""
		address: String!
	): SafeByResult
	"""
	Fetches a Safe by its contract address.

	Validates the provided hexadecimal address, queries the database for a matching safe contract,
	and returns a GraphQL-safe result wrapper indicating success, validation failure, or query failure.
	The function returns `None` when no safe with the given address exists.

	# Returns

	- `Some(SafeResult::Safe)` with the found safe on success.
	- `Some(SafeResult::InvalidAddress)` when the address format is invalid.
	- `Some(SafeResult::QueryFailed)` when the database query fails.
	- `None` when no safe is found for the given address.

	# Examples

	```
	// Example usage (executed in an async context with a prepared `ctx`):
	// let res = query_root.safe(&ctx, "0x0123...abcd".to_string()).await?;
	// match res {
	//     Some(SafeResult::Safe(s)) => println!("Found safe: {}", s.address),
	//     Some(SafeResult::InvalidAddress(err)) => eprintln!("Invalid address: {}", err.message),
	//     Some(SafeResult::QueryFailed(err)) => eprintln!("Query failed: {}", err.message),
	//     None => println!("Safe not found"),
	// }
	```
	"""
	safe(
		"""
		Safe contract address to query (hexadecimal format)
		"""
		address: String!
	): SafeResult @deprecated(reason: "Use safeBy(selector: ...)")
	"""
	Finds a Safe by chain key using the deprecated `safeByChainKey` resolver.

	The function validates the provided `chain_key` as an Ethereum-style hex address and returns one of the GraphQL
	union variants describing the outcome:
	- `Some(SafeResult::Safe(...))` when a matching safe is found,
	- `None` when no safe exists for the given chain key,
	- `Some(SafeResult::InvalidAddress(...))` when the `chain_key` is not a valid hex address,
	- `Some(SafeResult::QueryFailed(...))` when the database query fails.

	# Parameters

	- `chain_key`: Chain key to query (hexadecimal format).

	# Returns

	`Some(SafeResult::Safe)` with the found `Safe` if a record exists; `None` if no record exists;
	`Some(SafeResult::InvalidAddress)` if the chain key format is invalid; `Some(SafeResult::QueryFailed)` if
	the database query fails.

	# Examples

	```ignore
	// Given a prepared `query_root` and GraphQL `ctx`:
	let res = futures::executor::block_on(query_root.safe_by_chain_key(&ctx, "0x0123...".to_string())).unwrap();
	match res {
	Some(SafeResult::Safe(s)) => println!("Found safe: {}", s.address),
	Some(SafeResult::InvalidAddress(_)) => println!("Invalid chain key"),
	Some(SafeResult::QueryFailed(_)) => println!("Query failed"),
	None => println!("No safe for that chain key"),
	}
	```
	"""
	safeByChainKey(
		"""
		Chain key to query (hexadecimal format)
		"""
		chainKey: String!
	): SafeResult @deprecated(reason: "Use safeBy(selector: ...)")
	"""
	Fetches a Safe contract by registered node address.

	Returns the safe that a given node is registered to. If the node is not
	registered to any safe, returns `None`. On success, the returned `Safe` includes
	all node addresses registered to that safe in the `registered_nodes` field.

	# Arguments

	* `chain_key` - Hex-encoded Ethereum address of the registered node

	# Returns

	* `Some(SafeResult::Safe)` - The safe that the node is registered to
	* `None` - Node is not registered to any safe
	* `Some(SafeResult::InvalidAddress)` - Invalid address format
	* `Some(SafeResult::QueryFailed)` - Database error

	# Examples

	```ignore
	# use async_graphql::Context;
	# use crate::api::QueryRoot;
	# async fn doc_example(ctx: &Context<'_>) {
	let query = QueryRoot;
	let node_addr = "0x1234567890123456789012345678901234567890";
	match query.safe_by_registered_node(ctx, node_addr.to_string()).await.unwrap() {
	Some(crate::api::SafeResult::Safe(safe)) => {
	println!("Node registered to safe: {}", safe.address);
	}
	None => {
	println!("Node not registered to any safe");
	}
	_ => {}
	}
	# }
	```
	"""
	safeByRegisteredNode(chainKey: String!): SafeResult @deprecated(reason: "Use safeBy(selector: ...)")
	"""
	Fetches all indexed Safe contracts.

	On success returns `SafesResult::Safes` containing a `SafesList` with each safe's
	`address`, `module_address`, and `chain_key` encoded as hex strings. If the database
	query fails, returns `SafesResult::QueryFailed` with code `"QUERY_FAILED"` and a message.

	# Examples

	```ignore
	# use async_graphql::Context;
	# use crate::api::QueryRoot;
	# async fn doc_example(ctx: &Context<'_>) {
	let query = QueryRoot;
	let res = query.safes(ctx).await.unwrap();
	match res {
	crate::api::SafesResult::Safes(list) => {
	for safe in list.safes {
	println!("safe: {}", safe.address);
	}
	}
	crate::api::SafesResult::QueryFailed(err) => {
	eprintln!("query failed: {}", err.message);
	}
	}
	# }
	```
	"""
	safes: SafesResult!
	"""
	Returns the current chain configuration and runtime state exposed by the API.

	The returned `ChainInfo` contains the last indexed block number, the configured chain ID
	and network name, human-readable token values for ticket price and key binding fee,
	live gas fee estimates from RPC (`gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`) in wei,
	where `maxFeePerGas` and `maxPriorityFeePerGas` are scaled by `api.gas_multiplier`,
	minimum incoming ticket winning probability, optional 32-byte domain separator hashes
	for channels/ledger/safe registry as `Hex32`, a map of contract addresses, and an optional
	channel closure grace period in seconds.

	# Examples

	```
	# async fn doc_example() {
	// Query the GraphQL API for chain information
	let resp = /* execute GraphQL query `{ chainInfo { blockNumber chainId network } }` */ unimplemented!();
	// Inspect returned `ChainInfo` in the GraphQL response
	# }
	```
	"""
	chainInfo: ChainInfoResult!
	"""
	Health check endpoint

	Returns "ok" to indicate the service is running
	"""
	health: String!
	"""
	Client compatibility information

	Legacy endpoint retained for backward compatibility with older clients.
	Always reports `supported_client_versions = "*"` so any client version
	that calls this query is considered compatible.
	"""
	compatibility: Compatibility!
	"""
	Calculate the predicted module address for a Safe deployment

	Calls the HoprNodeStakeFactory.predictModuleAddress_1 function to compute
	the deterministic CREATE2 address for a HOPR node management module.
	"""
	calculateModuleAddress(
		"""
		Safe owner address (hexadecimal format)
		"""
		owner: String!,
		"""
		Safe deployment nonce
		"""
		nonce: UInt64!,
		"""
		Safe contract address (hexadecimal format)
		"""
		safeAddress: String!
	): CalculateModuleAddressResult!
	"""
	Sum the wxHOPR token balances across indexed safe contracts.

	When `owner_address` is provided, restricts to safes whose indexed owner
	set currently contains that address.
	"""
	safesBalance(
		"""
		Restrict to safes whose current owner set contains this address (hexadecimal format)
		"""
		ownerAddress: String
	): SafesBalanceResult!
	"""
	Count service registry entries matching optional filters.
	"""
	serviceCount(
		"""Filter by service type - ASCII name such as gvpn:exit, or 0x-prefixed hex"""
		serviceType: String,
		"""Filter by node chain address (hexadecimal format)"""
		node: String
	): CountResult!
	"""
	Retrieve the registry-wide service configuration.
	"""
	serviceRegistryConfig: ServiceRegistryConfigResult!
	"""
	Retrieve service type configuration, optionally filtered by service type.
	"""
	serviceTypes(
		"""Filter by service type - ASCII name such as gvpn:exit, or 0x-prefixed hex"""
		serviceType: String
	): ServiceTypesResult!
	"""
	Retrieve a stable, paginated view of service registry entries.
	"""
	services(
		"""Filter by service type - ASCII name such as gvpn:exit, or 0x-prefixed hex"""
		serviceType: String,
		"""Filter by node chain address (hexadecimal format)"""
		node: String,
		"""Maximum entries in this page (1-1000)"""
		first: Int! = 100,
		"""Cursor returned by the previous page"""
		after: UInt64,
		"""Watermark returned by the first page"""
		watermark: UInt64,
		"""Only entries whose node is bound in the registry's current NodeSafeRegistry"""
		liveOnly: Boolean! = false
	): ServicesResult!
	"""
	API version information

	Returns the current version of the blokli-api package
	"""
	version: String!
	"""
	Retrieve transaction status by ID

	Returns the current status of a previously submitted transaction.
	Returns Error with code INVALID_TRANSACTION_ID if ID format is invalid.
	Returns None if transaction ID is not found.
	"""
	transaction(id: ID!): TransactionResult
}

"""
Readiness state of the API server
"""
enum ReadinessState {
	"""
	Server is ready to accept GraphQL requests
	"""
	READY
	"""
	Server is not ready (usually during initial indexing)
	"""
	NOT_READY
}

"""
GraphQL output type for a ticket redemption event.

Uniquely identifies the ticket (`issuerAddress` + `recipientAddress` +
`epoch` + `index`) and reports whether it was accepted or rejected.

Returned by the `ticketRedeemed` subscription.
"""
type RedeemTicketDetails {
	"""
	Issuer account on-chain address in hexadecimal format
	"""
	issuerAddress: String!
	"""
	Recipient account on-chain address in hexadecimal format
	"""
	recipientAddress: String!
	"""
	Epoch of the channel where the ticket was redeemed
	"""
	epoch: UInt64!
	"""
	Index of the ticket within the channel epoch
	"""
	index: UInt64!
	"""
	Outcome of the redemption attempt
	"""
	result: RedemptionResult!
}

"""
Aggregated ticket redemption attempt statistics
"""
type RedeemedStats {
	"""
	Total amount redeemed from matching ticket redemption events
	"""
	redeemedAmount: TokenValueString!
	"""
	Total number of matching ticket redemption events
	"""
	redemptionCount: UInt64!
	"""
	Total amount from matching failed ticket redemption attempts
	"""
	rejectedAmount: TokenValueString!
	"""
	Total number of matching failed ticket redemption attempts
	"""
	rejectionCount: UInt64!
}

"""
Filter for ticket redemption stats queries.

At least one field must be provided. Providing both fields restricts the result
to the single matching safe/node pair; providing only one aggregates all rows
for that address.
"""
input RedeemedStatsFilter {
	"""
	Safe contract address to filter by (hexadecimal format)
	"""
	safeAddress: String
	"""
	Destination node address to filter by (hexadecimal format)
	"""
	nodeAddress: String
}

"""
Result type for redeemed statistics queries with safe/node filters
"""
union RedeemedStatsResult = RedeemedStats | MissingFilterError | InvalidAddressError | QueryFailedError

"""
Outcome of a ticket redemption attempt.

Carried in [`RedeemTicketDetails`] to allow subscribers to distinguish
successful on-chain redemptions from inner Safe transaction failures
(rejected) without polling the chain.
"""
enum RedemptionResult {
	"""
	Ticket was successfully redeemed on-chain.
	"""
	REDEEMED
	"""
	Ticket redemption was rejected (inner Safe transaction failed).
	"""
	REJECTED
}

"""
RPC or blockchain error during transaction submission
"""
type RpcError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
}

"""
HOPR Safe contract deployment information
"""
type Safe {
	"""
	Safe contract address (hexadecimal format)
	"""
	address: String!
	"""
	HOPR Node Management Module address (hexadecimal format)
	"""
	moduleAddress: String!
	"""
	Legacy chain key field retained for backward compatibility
	"""
	chainKey: String! @deprecated(reason: "Use owners instead. chainKey is legacy Safe metadata and may not reflect the current owner set.")
	"""
	Current signer threshold reconstructed from indexed Safe events
	"""
	threshold: String
	"""
	Current Safe owner addresses reconstructed from indexed Safe events
	"""
	owners: [String!]!
	"""
	List of node addresses (chain keys) registered to this safe via RegisteredNodeSafe events
	"""
	registeredNodes: [String!]!
}

"""
Result type for safe-by-selector query
"""
union SafeByResult = SafesList | InvalidAddressError | QueryFailedError

"""
Internal Safe contract execution result.

This is supplementary to [`TransactionStatus`]: the `status` field on [`Transaction`] is
the authoritative terminal outcome (e.g. `Confirmed` means the outer on-chain tx succeeded).
When `safe_execution` is present, it describes the *internal* Safe module call outcome,
which can differ from the outer tx status — a `Confirmed` transaction may still have
`safe_execution.success == false` if the internal call reverted.
"""
type SafeExecution {
	"""
	Whether the internal Safe transaction succeeded
	"""
	success: Boolean!
	"""
	Safe internal transaction hash (bytes32 hex).
	Null for module-executed transactions (`execTransactionFromModule`) which do not
	emit a txHash, or if the event data was malformed and the hash could not be extracted.
	"""
	safeTxHash: Hex32
	"""
	Revert reason (if execution failed and reason is decodable)
	"""
	revertReason: String
}

"""
Safe HOPR token allowance information for a specific Safe address
"""
type SafeHoprAllowance {
	"""
	Safe contract address
	"""
	address: String!
	"""
	wxHOPR token allowance granted by the safe to the channels contract
	"""
	allowance: TokenValueString!
}

"""
Result type for Safe HOPR allowance queries
"""
union SafeHoprAllowanceResult = SafeHoprAllowance | InvalidAddressError | QueryFailedError

"""
Result type for deprecated single-safe queries (`safe`, `safeByChainKey`, `safeByRegisteredNode`).
"""
union SafeResult = Safe | InvalidAddressError | QueryFailedError

"""
Selector for safe lookup queries.

This enum is used together with a single `address` argument when querying
for a safe. The selected variant determines how that `address` value is
interpreted:
- `Address`: `address` is the safe contract address
- `Owner`: `address` is a current safe owner address
- `ChainKey`: legacy alias for `Owner`
- `RegisteredNode`: `address` is a registered node address
"""
enum SafeSelectorInput {
	"""
	Safe contract address to filter by (hexadecimal format)
	"""
	ADDRESS
	"""
	Current safe owner address to filter by (hexadecimal format)
	"""
	OWNER
	"""
	Legacy alias for owner address filtering (hexadecimal format)
	"""
	CHAIN_KEY @deprecated(reason: "Use OWNER instead. CHAIN_KEY is a legacy alias for Safe owner lookup.")
	"""
	Registered node address to filter by (hexadecimal format)
	"""
	REGISTERED_NODE
}

"""
Aggregated wxHOPR holdings across all or a filtered subset of indexed safe contracts
"""
type SafesBalance {
	"""
	Sum of wxHOPR balances for all safe contract addresses
	"""
	balance: TokenValueString!
	"""
	Number of safes included
	"""
	count: Int!
}

"""
Result type for total safe wxHOPR balance query
"""
union SafesBalanceResult = InvalidAddressError | QueryFailedError | SafesBalance

"""
Success response for safes list query
"""
type SafesList {
	"""
	List of safes
	"""
	safes: [Safe!]!
}

"""
Result type for safes list query
"""
union SafesResult = SafesList | QueryFailedError

"""
Result type for asynchronous transaction submission
"""
union SendTransactionAsyncResult = Transaction | ContractNotAllowedError | FunctionNotAllowedError | RpcError

"""
Result type for fire-and-forget transaction submission
"""
union SendTransactionResult = SendTransactionSuccess | ContractNotAllowedError | FunctionNotAllowedError | RpcError

"""
Success response for fire-and-forget transaction submission
"""
type SendTransactionSuccess {
	"""
	Transaction hash after successful submission
	"""
	transactionHash: Hex32!
}

"""
Result type for synchronous transaction submission
"""
union SendTransactionSyncResult = Transaction | ContractNotAllowedError | FunctionNotAllowedError | RpcError | TimeoutError

"""
A single entry in the on-chain service registry: one node offering one service type.
"""
type ServiceEntry {
  "Service type identifier - ASCII name, or 0x-prefixed hex when the id is not printable ASCII"
  serviceType: String!
  "Chain address of the node offering the service (hexadecimal format)"
  node: String!
  "Safe that performed the last write to this entry (hexadecimal format)"
  safe: String!
  "Opaque metadata as 0x-prefixed hex; the schema belongs to the service type, not the registry"
  metadata: String!
  "Unix timestamp in seconds at which the entry was registered"
  registeredAt: UInt64!
  "Unix timestamp in seconds at which the entry was last updated"
  updatedAt: UInt64!
}

"""
Registry-wide configuration, shared by every service type.
"""
type ServiceRegistryConfig {
  "wxHOPR burned to register a new service type, as a decimal string in wei"
  typeRegistrationFee: String!
  "Node-safe registry the service registry resolves node bindings against (hexadecimal format)"
  nodeSafeRegistry: String!
}

"""
Result type for the registry-wide configuration query.
"""
union ServiceRegistryConfigResult = ServiceRegistryConfig | QueryFailedError

"""
Configuration of a single service type.
"""
type ServiceTypeInfo {
  "Service type identifier - ASCII name, or 0x-prefixed hex"
  serviceType: String!
  "Owner of the type; null once the type has been abandoned, which is one-way"
  owner: String
  "Requirement contract gating registration; null for an open type"
  requirement: String
  "wxHOPR burned on self-registration, as a decimal string in wei"
  registrationBurn: String!
  "wxHOPR burned on self-update, as a decimal string in wei"
  updateBurn: String!
}

"""
A change to service-type or registry-wide configuration.
"""
type ServiceTypeUpdate {
  "What changed"
  kind: ServiceTypeUpdateKind!
  "Service type affected; null for REGISTRATION_FEE_CHANGED and REGISTRY_POINTER_CHANGED"
  serviceType: String
  "Type configuration after the change; null for the two registry-wide kinds"
  config: ServiceTypeInfo
  "Registry-wide configuration after the change; null for the five per-type kinds"
  registryConfig: ServiceRegistryConfig
}

"Kind of change to service-type or registry-wide configuration"
enum ServiceTypeUpdateKind {
  REGISTERED
  OWNER_CHANGED
  REQUIREMENT_CHANGED
  REGISTRATION_BURN_CHANGED
  UPDATE_BURN_CHANGED
  REGISTRATION_FEE_CHANGED
  REGISTRY_POINTER_CHANGED
}

"Success response for the serviceTypes query"
type ServiceTypesList {
  "Matching service types"
  serviceTypes: [ServiceTypeInfo!]!
}

"""
Result type for the serviceTypes query
"""
union ServiceTypesResult = ServiceTypesList | QueryFailedError

"""
A change to one registry entry.
"""
type ServiceUpdate {
  "What happened to the entry"
  kind: ServiceUpdateKind!
  "Service type the entry belongs to"
  serviceType: String!
  "Node the entry belongs to (hexadecimal format)"
  node: String!
  "Entry state after the change; null for DEREGISTERED, where the entry no longer exists"
  entry: ServiceEntry
}

"Kind of change to a single registry entry"
enum ServiceUpdateKind {
  REGISTERED
  UPDATED
  DEREGISTERED
}

"Success response for the services query"
type ServicesList {
  "Matching registry entries"
  services: [ServiceEntry!]!
  "Fully indexed block at which this page is evaluated"
  watermark: UInt64!
  "Cursor for the next page, or null at the end"
  nextCursor: UInt64
}

"""
Result type for the services query
"""
union ServicesResult = ServicesList | MissingFilterError | QueryFailedError

"""
Root subscription type providing real-time updates via Server-Sent Events (SSE)
"""
type SubscriptionRoot {
	"""
	Stream indexed Curvy `PendingNotes` entries with an optional historical phase.
	"""
	curvyPendingNote(
		"""
		Earliest block number to replay before live streaming starts
		"""
		fromBlock: UInt64
	): CurvyPendingNote!
	"""
	Stream indexed Curvy `CommittedNotes` entries with an optional historical phase.
	"""
	curvyCommittedNote(
		"""
		Earliest block number to replay before live streaming starts
		"""
		fromBlock: UInt64
	): CurvyCommittedNote!
	"""
	Stream indexed Curvy `CommittedNullifiers` entries with an optional historical phase.
	"""
	curvyCommittedNullifier(
		"""
		Earliest block number to replay before live streaming starts
		"""
		fromBlock: UInt64
	): CurvyCommittedNullifier!
	"""
	Subscribe to health status updates of the API

	Provides updates whenever the server state changes.
	"""
	health: ReadinessState!
	"""
	Subscribe to real-time updates of payment channels

	**Streaming Behavior:**
	- Emits all matching channels once on subscription start (Phase 1)
	- Subsequently emits updates only when channels actually change (Phase 2)
	- Uses IndexerState event bus for real-time notifications

	**Phase 1 Ordering:**
	The initial snapshot (Phase 1) emits channels in randomized order to prevent
	clients from relying on a specific ordering. Clients that reconnect will
	receive entries in a different order each time.

	**Update Triggers:**
	A channel is re-emitted when:
	- The channel's status changes (e.g., OPEN -> PENDINGTOCLOSE -> CLOSED)
	- The channel's balance changes
	- The channel's epoch or ticket_index changes
	- A new channel opens that matches the filters

	**Filters:**
	All filters are optional and can be combined:
	- `source_key_id`: Only channels from this source account
	- `destination_key_id`: Only channels to this destination account
	- `concrete_channel_id`: Only this specific channel (with or without 0x prefix)
	- `status`: Only channels with this status (OPEN, CLOSED, PENDINGTOCLOSE)

	**Automatic Shutdown:**
	The subscription automatically terminates on blockchain reorganization,
	requiring clients to reconnect to re-establish consistent state.
	"""
	channelUpdated(
		"""
		Filter by source node keyid
		"""
		sourceKeyId: Int,
		"""
		Filter by destination node keyid
		"""
		destinationKeyId: Int,
		"""
		Filter by concrete channel ID (hexadecimal format)
		"""
		concreteChannelId: String,
		"""
		Filter by channel status
		"""
		status: ChannelStatus
	): Channel!
	"""
	Subscribe to the opened payment channels graph with real-time updates

	**Streaming Behavior:**
	- Emits one OpenedChannelsGraphEntry per open channel
	- Each entry contains a single channel with its source and destination accounts
	- On subscription start, emits all existing open channels as separate entries
	- Subsequently, emits updates when any channel changes, including non-open states

	**Phase 1 Ordering:**
	The initial snapshot (Phase 1) emits channels in randomized order to prevent
	clients from relying on a specific ordering. Clients that reconnect will
	receive entries in a different order each time.

	**Building the Graph:**
	Clients receive entries incrementally (one per channel) and should accumulate
	them to build the complete network topology. Entries should be merged by
	concrete channel ID. Closed-channel entries are intentional removal signals
	for consumers that maintain an open-channel graph.

	**Update Triggers:**
	An entry is re-emitted for a channel when:
	- The channel's status changes (e.g., OPEN -> PENDINGTOCLOSE)
	- The channel's balance changes
	- The channel closes (emitted with CLOSED status so consumers can remove it)
	- A new channel opens (new entry emitted)

	**Example:**
	If the network has three open channels: channelA (A->B), channelB (B->A), channelC (A->C),
	the subscription emits three separate OpenedChannelsGraphEntry objects, each containing
	one channel with its source and destination accounts.

	**Note:** This is a directed graph. Bidirectional communication requires
	channels in both directions, each emitted as a separate entry.
	"""
	openedChannelGraphUpdated: OpenedChannelsGraphEntry!
	"""
	Subscribe to real-time updates of account information

	Provides updates whenever there is a change in account information, including
	balance changes, Safe address linking, and multiaddress announcements.
	Optional filters can be applied to only receive updates for specific accounts.

	Uses the IndexerState event bus for real-time notifications:
	- Emits matching accounts on subscription start (Phase 1)
	- Streams updates when `IndexerEvent::AccountUpdated` events are received (Phase 2)
	- Automatically shuts down on blockchain reorganization

	**Phase 1 Ordering:**
	The initial snapshot (Phase 1) emits accounts in randomized order to prevent
	clients from relying on a specific ordering. Clients that reconnect will
	receive entries in a different order each time.
	"""
	accountUpdated(
		"""
		Filter by account keyid
		"""
		keyid: Int,
		"""
		Filter by packet key (peer ID format)
		"""
		packetKey: String,
		"""
		Filter by chain key (hexadecimal format)
		"""
		chainKey: String
	): Account!
	"""
	Subscribe to real-time updates of ticket price and winning probability

	Provides updates whenever there is a change in the ticket price or minimum
	winning probability on-chain. These values are essential for ticket validation
	and payment channel operation.

	Uses the IndexerState event bus for real-time notifications:
	- Emits current value on subscription start
	- Streams updates when TicketParametersUpdated events are received
	- Automatically shuts down on blockchain reorganization
	"""
	ticketParametersUpdated: TicketParameters!
	"""
	Streams updates to the key binding fee.

	Emits the current fee once when the subscription starts, then emits new fee
	values whenever a `KeyBindingFeeUpdated` event is processed while the indexer
	is synced. Consecutive duplicate fee values are suppressed.

	# Examples

	```no_run
	use futures::StreamExt;

	// In an async context with a GraphQL `Context` available:
	// let stream = root.key_binding_fee_updated(&ctx).await.unwrap();
	// let mut stream = Box::pin(stream);
	// if let Some(fee) = stream.next().await {
	//     println!("current fee: {}", fee.0);
	// }
	```
	"""
	keyBindingFeeUpdated: TokenValueString!
	"""
	Streams newly deployed safes as `Safe` objects.

	The stream yields a `Safe` for each `SafeDeployed` event observed by the indexer.

	# Examples

	```ignore
	# use futures::StreamExt;
	// `root` is a `SubscriptionRoot` and `ctx` is an `async_graphql::Context<'_>`
	let mut stream = root.safe_deployed(&ctx).await.unwrap();
	while let Some(safe) = stream.next().await {
	println!("{}", safe.address);
	}
	```
	"""
	safeDeployed: Safe!
	"""
	Subscribe to the complete registry-wide configuration.
	"""
	serviceRegistryConfigUpdated: ServiceRegistryConfig!
	"""
	Subscribe to real-time changes of service type and registry-wide configuration.
	"""
	serviceTypeUpdated(
		"""Filter by service type - ASCII name such as gvpn:exit, or 0x-prefixed hex"""
		serviceType: String
	): ServiceTypeUpdate!
	"""
	Subscribe to real-time changes of service registry entries.
	"""
	serviceUpdated(
		"""Filter by service type - ASCII name such as gvpn:exit, or 0x-prefixed hex"""
		serviceType: String,
		"""Filter by node chain address (hexadecimal format)"""
		node: String
	): ServiceUpdate!
	"""
	Subscribe to real-time updates of a specific transaction

	Provides updates whenever the status of the specified transaction changes,
	including validation, submission, confirmation, revert, and failure events.

	Uses event-driven architecture to receive updates immediately when transaction
	status changes, with zero polling overhead. Follows a 2-phase approach:
	- Phase 1: Emit current transaction state if it exists
	- Phase 2: Listen for future status update events
	"""
	transactionUpdated(
		"""
		Transaction ID to monitor (UUID)
		"""
		id: ID!
	): Transaction!
	"""
	Subscribe to real-time updates of ticket redemptions.

	Streams a [`RedeemTicketDetails`] item each time a ticket redemption event
	is observed on-chain. Covers both successful redemptions and inner Safe
	transaction rejections (see [`RedemptionResult`]).

	At most one of the three filter arguments is typically supplied. When none
	are given, all ticket redemption events are emitted. Input addresses and
	channel IDs are validated as hex before the stream is established.
	"""
	ticketRedeemed(
		"""
		Filter by channel ID (hexadecimal format)
		"""
		channelId: ID,
		"""
		Filter by ticket issuer (hexadecimal format)
		"""
		issuerAddress: ID,
		"""
		Filter by ticket recipient (hexadecimal format)
		"""
		recipientAddress: ID
	): RedeemTicketDetails!
}

"""
Ticket price and winning probability parameters
"""
type TicketParameters {
	"""
	Current minimum ticket winning probability (decimal value between 0.0 and 1.0)
	"""
	minTicketWinningProbability: Float!
	"""
	Current HOPR token price
	"""
	ticketPrice: TokenValueString!
}

"""
Operation timed out
"""
type TimeoutError {
	"""
	Error code
	"""
	code: String!
	"""
	Human-readable error message
	"""
	message: String!
}

"""
Token type for balance queries
"""
enum Token {
	"""
	wxHOPR token
	"""
	HOPR
	"""
	xHOPR token
	"""
	XHOPR
	"""
	Native token
	"""
	NATIVE
}

scalar TokenValueString

"""
Transaction submission result
"""
type Transaction {
	"""
	Unique identifier for the transaction (UUID)
	"""
	id: ID!
	"""
	Current status of the transaction
	"""
	status: TransactionStatus!
	"""
	Timestamp when transaction was submitted
	"""
	submittedAt: DateTime!
	"""
	Transaction hash from successful blockchain submission
	"""
	transactionHash: Hex32!
	"""
	Internal Safe execution result (null for non-Safe transactions or before confirmation)
	"""
	safeExecution: SafeExecution
}

"""
Transaction count information for any Ethereum address

For EOAs (Externally Owned Accounts): Returns the transaction count via eth_getTransactionCount
For Safe contracts: Returns the internal nonce via nonce() function
For other contracts: Attempts nonce() call, falls back to eth_getTransactionCount
"""
type TransactionCount {
	"""
	Address queried (hexadecimal format)
	"""
	address: String!
	"""
	Current transaction count or nonce for the address
	"""
	count: UInt64!
}

"""
Result type for transaction count queries
"""
union TransactionCountResult = TransactionCount | InvalidAddressError | QueryFailedError

"""
Input for transaction submission
"""
input TransactionInput {
	"""
	Raw signed transaction data in hexadecimal format (with or without 0x prefix)
	"""
	rawTransaction: String!
}

"""
Result type for transaction query
"""
union TransactionResult = Transaction | InvalidTransactionIdError

"""
Status of a submitted transaction
"""
enum TransactionStatus {
	"""
	Transactions are never emitted in this state; they go directly to Submitted.
	"""
	PENDING @deprecated(reason: "Transactions go directly to SUBMITTED. This variant exists only for backwards compatibility and will be removed in a future release.")
	"""
	Transaction has been submitted and is awaiting confirmation
	"""
	SUBMITTED
	"""
	Transaction has been confirmed on-chain with success
	"""
	CONFIRMED
	"""
	Transaction was included on-chain but reverted (receipt.status = 0)
	"""
	REVERTED
	"""
	Transaction was not mined within timeout window
	"""
	TIMEOUT
	"""
	Transaction validation failed
	"""
	VALIDATION_FAILED
	"""
	Transaction submission failed
	"""
	SUBMISSION_FAILED
}

scalar UInt256

scalar UInt64

"""
Marks an element of a GraphQL schema as no longer supported.
"""
directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
"""
Directs the executor to include this field or fragment only when the `if` argument is true.
"""
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
"""
Directs the executor to skip this field or fragment when the `if` argument is true.
"""
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
"""
Provides a scalar specification URL for specifying the behavior of custom scalar types.
"""
directive @specifiedBy(url: String!) on SCALAR
schema {
	query: QueryRoot
	mutation: MutationRoot
	subscription: SubscriptionRoot
}