-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkth_native.pyi
More file actions
1631 lines (1429 loc) · 92.4 KB
/
Copy pathkth_native.pyi
File metadata and controls
1631 lines (1429 loc) · 92.4 KB
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
# Copyright (c) 2016-present Knuth Project developers.
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# pyright: strict
"""Type stubs for the `kth_native` CPython extension.
The hand-written sections cover:
* the eight Python-visible types exposed by the C extension
(`Settings`, `BlockchainSettings`, `DatabaseSettings`,
`NetworkSettings`, `NodeSettings`, `Authority`, `Endpoint`,
`Checkpoint`), with every member that ships in the modern C-API; and
* the small set of "front-door" functions that downstream consumers
(most notably `py-api`) actually call by hand: `node_*`, `config_*`,
`wallet_payment_address_*`, the per-network helpers, and the chain
fetch entry points.
Everything else (most of the 169 `chain_*` helpers — block / header /
transaction / input / output / script / merkle / history / stealth
plumbing) is enumerated below as `(*args, **kwargs) -> Any` so that
IDE name-completion and "is this exported?" checks still work, while
keeping this file maintainable. Type those in a follow-up pass when a
specific call site needs strict signatures.
"""
from __future__ import annotations
from collections.abc import Callable
from typing import Any, Final
# ─────────────────────────────────────────────────────────────────────
# Enums (modeled as Final ints — the C-API doesn't ship Python enums)
# ─────────────────────────────────────────────────────────────────────
# kth_network_t — values must match the kth-c-api primitives.h enum.
NETWORK_MAINNET: Final[int] = 0
NETWORK_TESTNET: Final[int] = 1
NETWORK_REGTEST: Final[int] = 2
NETWORK_TESTNET4: Final[int] = 3
NETWORK_SCALENET: Final[int] = 4
NETWORK_CHIPNET: Final[int] = 5
# kth_db_mode_t
DB_MODE_PRUNED: Final[int] = 0
DB_MODE_NORMAL: Final[int] = 1
DB_MODE_FULL_INDEXED: Final[int] = 2
# StartModules — values for the second arg of node_init_run_and_wait_for_signal.
START_MODULES_JUST_CHAIN: Final[int] = 1
START_MODULES_FULL: Final[int] = 2
# ─────────────────────────────────────────────────────────────────────
# Settings types
# ─────────────────────────────────────────────────────────────────────
class NodeSettings:
"""Mirror of `kth_node_settings`."""
sync_peers: int
sync_timeout_seconds: int
block_latency_seconds: int
refresh_transactions: bool
compact_blocks_high_bandwidth: bool
ds_proofs_enabled: bool
def __init__(self) -> None: ...
class DatabaseSettings:
"""Mirror of `kth_database_settings`."""
directory: str
db_mode: int # one of DB_MODE_*
reorg_pool_limit: int
db_max_size: int
safe_mode: bool
cache_capacity: int
def __init__(self) -> None: ...
class Checkpoint:
"""Mirror of `kth_checkpoint`."""
hash: bytes # 32 bytes, big-endian (display order)
height: int
def __init__(self) -> None: ...
class Authority:
"""Mirror of `kth_authority` — host:port pair."""
ip: str
port: int
def __init__(self) -> None: ...
class Endpoint:
"""Mirror of `kth_endpoint` — scheme://host:port triple."""
scheme: str
host: str
port: int
def __init__(self) -> None: ...
class BlockchainSettings:
"""Mirror of `kth_blockchain_settings`. BCH-specific fields are
only meaningful when the build was compiled with `KTH_CURRENCY_BCH`."""
cores: int
priority: bool
byte_fee_satoshis: float
sigop_fee_satoshis: float
minimum_output_satoshis: int
notify_limit_hours: int
reorganization_limit: int
checkpoints: list[Checkpoint]
fix_checkpoints: bool
allow_collisions: bool
easy_blocks: bool
retarget: bool
# BIPs (consensus toggles).
bip16: bool
bip30: bool
bip34: bool
bip66: bool
bip65: bool
bip90: bool
bip68: bool
bip112: bool
bip113: bool
# BCH hard-forks (already activated on every shipped network).
bch_uahf: bool
bch_daa_cw144: bool
bch_pythagoras: bool
bch_euclid: bool
bch_pisano: bool
bch_mersenne: bool
bch_fermat: bool
bch_euler: bool
bch_gauss: bool
bch_descartes: bool
bch_lobachevski: bool
bch_galois: bool
# Future hard-forks: timestamps only, the bool flags will be added
# in a later kth release.
leibniz_activation_time: int # 2026-May
cantor_activation_time: int # 2027-May
asert_half_life: int
def __init__(self) -> None: ...
class NetworkSettings:
"""Mirror of `kth_network_settings`."""
threads: int
protocol_maximum: int
protocol_minimum: int
services: int
invalid_services: int
relay_transactions: bool
validate_checksum: bool
identifier: int
inbound_port: int
inbound_connections: int
outbound_connections: int
manual_attempt_limit: int
connect_batch_size: int
connect_timeout_seconds: int
channel_handshake_seconds: int
channel_heartbeat_minutes: int
channel_inactivity_minutes: int
channel_expiration_minutes: int
channel_germination_seconds: int
host_pool_capacity: int
hosts_file: str
self: Authority
blacklist: list[Authority]
peers: list[Endpoint]
seeds: list[Endpoint]
debug_file: str
error_file: str
archive_directory: str
rotation_size: int
minimum_free_space: int
maximum_archive_size: int
maximum_archive_files: int
statistics_server: Authority
verbose: bool
use_ipv6: bool
user_agent_blacklist: list[str]
def __init__(self) -> None: ...
class Settings:
"""Mirror of `kth_settings` — the top-level config bundle."""
node: NodeSettings
chain: BlockchainSettings
database: DatabaseSettings
network: NetworkSettings
def __init__(self) -> None: ...
# ─────────────────────────────────────────────────────────────────────
# Opaque handles (returned by C, passed back into C — they're
# PyCapsule objects under the hood, but Python sees them as `object`)
# ─────────────────────────────────────────────────────────────────────
# Type aliases for documentation only — they all resolve to `object` so
# the type-checker doesn't reject passing them around.
Node = object
Chain = object
P2P = object
Block = object
# `Header` is defined as a real class in the AUTO-GENERATED STUBS block below.
ChainState = object
Transaction = object
Input = object
Output = object
Script = object
Operation = object
PaymentAddress = object
OutputPoint = object
Hash = bytes # always 32 bytes
# ─────────────────────────────────────────────────────────────────────
# Front-door API: config + node lifecycle
# ─────────────────────────────────────────────────────────────────────
def config_settings_default(network: int) -> Settings: ...
def config_node_settings_default(network: int) -> NodeSettings: ...
def config_database_settings_default(network: int) -> DatabaseSettings: ...
def config_network_settings_default(network: int) -> NetworkSettings: ...
def config_blockchain_settings_default(network: int) -> BlockchainSettings: ...
def config_settings_get_from_file(
path: str,
) -> tuple[int, Settings | None, str | None]:
"""Load settings from a config file.
Returns a 3-tuple `(ok, settings, error)`:
* on success: `(1, settings, None)`
* on failure: `(0, None, error_message)`
"""
...
def node_construct(settings: Settings, stdout_console: bool, /) -> Node: ...
def node_destruct(node: Node, /) -> None: ...
def node_chain(node: Node, /) -> Chain: ...
def node_p2p(node: Node, /) -> P2P: ...
def node_signal_stop(node: Node, /) -> None: ...
def node_print_thread_id() -> None: ...
def node_init_run_and_wait_for_signal(
node: Node,
start_modules: int,
callback: Callable[[int], Any],
/,
) -> None: ...
def p2p_address_count(p2p: P2P, /) -> int: ...
def p2p_close(p2p: P2P, /) -> None: ...
def p2p_stop(p2p: P2P, /) -> None: ...
def p2p_stopped(p2p: P2P, /) -> bool: ...
# ─────────────────────────────────────────────────────────────────────
# Wallet — payment address triple
# ─────────────────────────────────────────────────────────────────────
def wallet_payment_address_construct_from_string(addr: str, /) -> PaymentAddress: ...
def wallet_payment_address_destruct(addr: PaymentAddress, /) -> None: ...
def wallet_payment_address_version(addr: PaymentAddress, /) -> int: ...
def wallet_payment_address_encoded_legacy(addr: PaymentAddress, /) -> str: ...
# NOTE: the `_cashaddr` and `_token` variants are only compiled in when
# the C extension was built with `KTH_CURRENCY=BCH` (the default). On
# BTC/LTC builds these functions are absent at runtime; calling them
# raises `AttributeError`. Until py-native ships per-currency stubs we
# expose them unconditionally — guard call sites with a feature check
# (`hasattr(kth_native, "wallet_payment_address_encoded_cashaddr")`)
# in code that needs to work across currencies.
def wallet_payment_address_encoded_cashaddr(
addr: PaymentAddress, token_aware: bool, /
) -> str: ...
def wallet_payment_address_encoded_token(addr: PaymentAddress, /) -> str: ...
# ─────────────────────────────────────────────────────────────────────
# A handful of typed `chain_*` entry points commonly called by hand.
# ─────────────────────────────────────────────────────────────────────
def chain_fetch_last_height(
chain: Chain, callback: Callable[[int, int], Any], /
) -> None: ...
def chain_fetch_block_by_height(
chain: Chain, height: int, callback: Callable[[int, Block, int], Any], /
) -> None: ...
def chain_fetch_block_by_hash(
chain: Chain, hash: Hash, callback: Callable[[int, Block, int], Any], /
) -> None: ...
def chain_fetch_block_height(
chain: Chain, hash: Hash, callback: Callable[[int, int], Any], /
) -> None: ...
def chain_fetch_transaction(
chain: Chain,
hash: Hash,
require_confirmed: bool,
callback: Callable[[int, Transaction, int, int], Any],
/,
) -> None: ...
def chain_block_destruct(block: Block, /) -> None: ...
def chain_block_hash(block: Block, /) -> Hash: ...
def chain_block_header(block: Block, /) -> Header: ...
def chain_block_transactions(block: Block, /) -> object: ...
def chain_block_serialized_size(block: Block, /) -> int: ...
def chain_block_factory_from_data(data: bytes, /) -> Block: ...
def chain_transaction_destruct(tx: Transaction, /) -> None: ...
def chain_transaction_hash(tx: Transaction, /) -> bytearray: ...
def chain_transaction_locktime(tx: Transaction, /) -> int: ...
def chain_transaction_factory_from_data(data: bytes, /) -> Transaction: ...
# chain_header / chain_script / chain_output_point / chain_point stubs are
# auto-generated below the AUTO-GENERATED block once each class is migrated.
# ─────────────────────────────────────────────────────────────────────
# All remaining `chain_*` helpers — left as untyped catch-alls. Promote
# to a real signature above when a caller actually needs strict types.
# ─────────────────────────────────────────────────────────────────────
def chain_block_claim(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_construct(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_fees(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_generate_merkle_root(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_distinct_transaction_set(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_extra_coinbases(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_final(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_internal_double_spend(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_valid(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_valid_coinbase_claim(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_valid_coinbase_script(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_is_valid_merkle_root(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_list_construct_default(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_list_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_list_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_list_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_list_push_back(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_reward(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_signature_operations(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_signature_operations_bip16_active(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_to_data(*args: Any, **kwargs: Any) -> Any: ...
def chain_block_total_inputs(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_header(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_is_valid(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_nonce(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_reset(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_serialized_size(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_transaction_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_compact_block_transaction_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_block_header_by_hash(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_block_header_by_height(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_compact_block_by_hash(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_compact_block_by_height(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_history(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_merkle_block_by_hash(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_merkle_block_by_height(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_spend(*args: Any, **kwargs: Any) -> Any: ...
def chain_fetch_transaction_position(*args: Any, **kwargs: Any) -> Any: ...
# chain_header stubs are auto-generated (see AUTO-GENERATED block).
def chain_history_compact_height(*args: Any, **kwargs: Any) -> Any: ...
def chain_history_compact_list_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_history_compact_list_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_history_compact_list_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_history_compact_point(*args: Any, **kwargs: Any) -> Any: ...
def chain_history_compact_point_kind(*args: Any, **kwargs: Any) -> Any: ...
def chain_history_compact_value_or_previous_checksum(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_construct(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_factory_from_data(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_is_final(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_is_valid(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_list_construct_default(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_list_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_list_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_list_push_back(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_previous_output(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_script(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_sequence(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_serialized_size(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_signature_operations(*args: Any, **kwargs: Any) -> Any: ...
def chain_input_to_data(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_hash_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_header(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_is_valid(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_reset(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_serialized_size(*args: Any, **kwargs: Any) -> Any: ...
def chain_merkle_block_total_transaction_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_organize_block(*args: Any, **kwargs: Any) -> Any: ...
def chain_organize_transaction(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_construct(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_factory_from_data(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_is_valid(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_list_construct_default(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_list_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_list_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_list_push_back(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_script(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_serialized_size(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_signature_operations(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_to_data(*args: Any, **kwargs: Any) -> Any: ...
def chain_output_value(*args: Any, **kwargs: Any) -> Any: ...
def chain_stealth_compact_ephemeral_public_key_hash(*args: Any, **kwargs: Any) -> Any: ...
def chain_stealth_compact_list_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_stealth_compact_list_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_stealth_compact_list_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_stealth_compact_public_key_hash(*args: Any, **kwargs: Any) -> Any: ...
def chain_stealth_compact_transaction_hash(*args: Any, **kwargs: Any) -> Any: ...
def chain_subscribe_blockchain(*args: Any, **kwargs: Any) -> Any: ...
def chain_subscribe_transaction(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_construct(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_fees(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_inputs(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_coinbase(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_double_spend(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_final(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_locktime_conflict(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_mature(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_missing_previous_outputs(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_null_non_coinbase(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_oversized_coinbase(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_overspent(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_is_valid(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_list_construct_default(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_list_count(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_list_destruct(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_list_nth(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_list_push_back(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_outputs(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_serialized_size(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_set_version(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_signature_operations(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_signature_operations_bip16_active(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_to_data(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_total_input_value(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_total_output_value(*args: Any, **kwargs: Any) -> Any: ...
def chain_transaction_version(*args: Any, **kwargs: Any) -> Any: ...
def chain_unsubscribe(*args: Any, **kwargs: Any) -> Any: ...
def chain_validate_tx(*args: Any, **kwargs: Any) -> Any: ...
# ── AUTO-GENERATED STUBS START ──────────────────────────────────────
# ─── Block (auto-generated, do not edit) ─────────────────────────
class Block:
"""Opaque handle to a `kth::domain::chain::block`. Constructed by
`chain_block_construct_*` and released by
`chain_block_destruct`."""
...
def chain_block_construct_default() -> Block: ...
def chain_block_construct_from_data(reader: bytes, wire: bool) -> Block: ...
def chain_block_construct(header: "Header", transactions: object) -> Block: ...
def chain_block_copy(self: Block) -> Block: ...
def chain_block_destruct(self: Block) -> None: ...
def chain_block_to_data_simple(self: Block) -> bytes: ...
def chain_block_serialized_size(self: Block) -> int: ...
def chain_block_set_transactions(self: Block, value: object) -> None: ...
def chain_block_genesis_mainnet() -> "Block" | None: ...
def chain_block_genesis_testnet() -> "Block" | None: ...
def chain_block_genesis_regtest() -> "Block" | None: ...
def chain_block_genesis_testnet4() -> "Block" | None: ...
def chain_block_genesis_scalenet() -> "Block" | None: ...
def chain_block_genesis_chipnet() -> "Block" | None: ...
def chain_block_locator_size(top: int) -> int: ...
def chain_block_locator_heights(top: int) -> object | None: ...
def chain_block_signature_operations_simple(self: Block) -> int: ...
def chain_block_total_inputs(self: Block, with_coinbase: bool) -> int: ...
def chain_block_check(self: Block) -> int: ...
def chain_block_accept(self: Block, flags: int, height: int, median_time_past: int, max_block_size_dynamic: int, max_sigops: int, is_under_checkpoint: bool, transactions: bool) -> int: ...
def chain_block_connect(self: Block) -> int: ...
def chain_block_equals(self: Block, other: Block) -> bool: ...
def chain_block_is_valid(self: Block) -> bool: ...
def chain_block_to_data(self: Block, serialized_size: int) -> bytes: ...
def chain_block_to_hashes(self: Block) -> object | None: ...
def chain_block_header(self: Block) -> "Header" | None: ...
def chain_block_set_header(self: Block, value: "Header") -> None: ...
def chain_block_transactions(self: Block) -> "TransactionList" | None: ...
def chain_block_hash(self: Block) -> bytes: ...
def chain_block_subsidy(height: int, retarget: bool) -> int: ...
def chain_block_fees(self: Block) -> int: ...
def chain_block_claim(self: Block) -> int: ...
def chain_block_reward(self: Block, height: int) -> int: ...
def chain_block_generate_merkle_root(self: Block) -> bytes: ...
def chain_block_signature_operations(self: Block, bip16: bool, bip141: bool) -> int: ...
def chain_block_is_extra_coinbases(self: Block) -> bool: ...
def chain_block_is_final(self: Block, height: int, block_time: int) -> bool: ...
def chain_block_is_distinct_transaction_set(self: Block) -> bool: ...
def chain_block_is_valid_coinbase_claim(self: Block, height: int) -> bool: ...
def chain_block_is_valid_coinbase_script(self: Block, height: int) -> bool: ...
def chain_block_is_forward_reference(self: Block) -> bool: ...
def chain_block_is_canonical_ordered(self: Block) -> bool: ...
def chain_block_is_internal_double_spend(self: Block) -> bool: ...
def chain_block_is_valid_merkle_root(self: Block) -> bool: ...
def chain_block_check_transactions(self: Block) -> int: ...
def chain_block_accept_transactions(self: Block, flags: int, height: int, median_time_past: int, max_sigops: int, is_under_checkpoint: bool) -> int: ...
def chain_block_connect_transactions(self: Block, state: "ChainState") -> int: ...
def chain_block_reset(self: Block) -> None: ...
def chain_block_non_coinbase_input_count(self: Block) -> int: ...
# ─── BlockList (auto-generated, do not edit) ─────────────────────────
class BlockList:
"""Opaque handle to a `std::vector<kth::domain::chain::block>`."""
...
def chain_block_list_construct_default() -> BlockList: ...
def chain_block_list_push_back(list: BlockList, elem: Block) -> None: ...
def chain_block_list_destruct(list: BlockList) -> None: ...
def chain_block_list_count(list: BlockList) -> int: ...
def chain_block_list_nth(list: BlockList, index: int) -> Block: ...
def chain_block_list_assign_at(list: BlockList, index: int, elem: Block) -> None: ...
def chain_block_list_erase(list: BlockList, index: int) -> None: ...
# ─── Header (auto-generated, do not edit) ─────────────────────────
class Header:
"""Opaque handle to a `kth::domain::chain::header`. Constructed by
`chain_header_construct_*` and released by
`chain_header_destruct`."""
...
def chain_header_construct_default() -> Header: ...
def chain_header_construct_from_data(reader: bytes, wire: bool) -> Header: ...
def chain_header_construct(version: int, previous_block_hash: bytes, merkle: bytes, timestamp: int, bits: int, nonce: int) -> Header: ...
def chain_header_copy(self: Header) -> Header: ...
def chain_header_destruct(self: Header) -> None: ...
def chain_header_to_data(self: Header, wire: bool) -> bytes: ...
def chain_header_serialized_size(self: Header, wire: bool) -> int: ...
def chain_header_set_version(self: Header, value: int) -> None: ...
def chain_header_set_previous_block_hash(self: Header, value: bytes) -> None: ...
def chain_header_set_merkle(self: Header, value: bytes) -> None: ...
def chain_header_set_timestamp(self: Header, value: int) -> None: ...
def chain_header_set_bits(self: Header, value: int) -> None: ...
def chain_header_set_nonce(self: Header, value: int) -> None: ...
def chain_header_hash_pow(self: Header) -> bytes: ...
def chain_header_is_valid_proof_of_work(self: Header, retarget: bool) -> bool: ...
def chain_header_check(self: Header, retarget: bool) -> int: ...
def chain_header_accept(self: Header, state: "ChainState") -> int: ...
def chain_header_reset(self: Header) -> None: ...
def chain_header_equals(self: Header, other: Header) -> bool: ...
def chain_header_is_valid(self: Header) -> bool: ...
def chain_header_satoshi_fixed_size() -> int: ...
def chain_header_version(self: Header) -> int: ...
def chain_header_previous_block_hash(self: Header) -> bytes: ...
def chain_header_merkle(self: Header) -> bytes: ...
def chain_header_timestamp(self: Header) -> int: ...
def chain_header_bits(self: Header) -> int: ...
def chain_header_nonce(self: Header) -> int: ...
def chain_header_is_valid_timestamp(self: Header) -> bool: ...
# ─── Point (auto-generated, do not edit) ─────────────────────────
class Point:
"""Opaque handle to a `kth::domain::chain::point`. Constructed by
`chain_point_construct_*` and released by
`chain_point_destruct`."""
...
def chain_point_construct_default() -> Point: ...
def chain_point_construct_from_data(reader: bytes, wire: bool) -> Point: ...
def chain_point_construct(hash: bytes, index: int) -> Point: ...
def chain_point_copy(self: Point) -> Point: ...
def chain_point_destruct(self: Point) -> None: ...
def chain_point_equals(self: Point, other: Point) -> bool: ...
def chain_point_null() -> "Point" | None: ...
def chain_point_is_valid(self: Point) -> bool: ...
def chain_point_to_data(self: Point, wire: bool) -> bytes: ...
def chain_point_satoshi_fixed_size() -> int: ...
def chain_point_serialized_size(self: Point, wire: bool) -> int: ...
def chain_point_hash(self: Point) -> bytes: ...
def chain_point_set_hash(self: Point, value: bytes) -> None: ...
def chain_point_index(self: Point) -> int: ...
def chain_point_set_index(self: Point, value: int) -> None: ...
def chain_point_checksum(self: Point) -> int: ...
def chain_point_is_null(self: Point) -> bool: ...
def chain_point_reset(self: Point) -> None: ...
# ─── PointList (auto-generated, do not edit) ─────────────────────────
class PointList:
"""Opaque handle to a `std::vector<kth::domain::chain::point>`."""
...
def chain_point_list_construct_default() -> PointList: ...
def chain_point_list_push_back(list: PointList, elem: Point) -> None: ...
def chain_point_list_destruct(list: PointList) -> None: ...
def chain_point_list_count(list: PointList) -> int: ...
def chain_point_list_nth(list: PointList, index: int) -> Point: ...
def chain_point_list_assign_at(list: PointList, index: int, elem: Point) -> None: ...
def chain_point_list_erase(list: PointList, index: int) -> None: ...
# ─── OutputPoint (auto-generated, do not edit) ─────────────────────────
class OutputPoint:
"""Opaque handle to a `kth::domain::chain::output_point`. Constructed by
`chain_output_point_construct_*` and released by
`chain_output_point_destruct`."""
...
def chain_output_point_construct_default() -> OutputPoint: ...
def chain_output_point_construct_from_data(reader: bytes, wire: bool) -> OutputPoint: ...
def chain_output_point_construct_from_hash_index(hash: bytes, index: int) -> OutputPoint: ...
def chain_output_point_construct_from_point(x: "Point") -> OutputPoint: ...
def chain_output_point_copy(self: OutputPoint) -> OutputPoint: ...
def chain_output_point_destruct(self: OutputPoint) -> None: ...
def chain_output_point_equals(self: OutputPoint, other: OutputPoint) -> bool: ...
def chain_output_point_is_mature(self: OutputPoint, height: int) -> bool: ...
def chain_output_point_is_valid(self: OutputPoint) -> bool: ...
def chain_output_point_to_data(self: OutputPoint, wire: bool) -> bytes: ...
def chain_output_point_satoshi_fixed_size() -> int: ...
def chain_output_point_serialized_size(self: OutputPoint, wire: bool) -> int: ...
def chain_output_point_hash(self: OutputPoint) -> bytes: ...
def chain_output_point_set_hash(self: OutputPoint, value: bytes) -> None: ...
def chain_output_point_index(self: OutputPoint) -> int: ...
def chain_output_point_set_index(self: OutputPoint, value: int) -> None: ...
def chain_output_point_checksum(self: OutputPoint) -> int: ...
def chain_output_point_is_null(self: OutputPoint) -> bool: ...
def chain_output_point_reset(self: OutputPoint) -> None: ...
# ─── OutputPointList (auto-generated, do not edit) ─────────────────────────
class OutputPointList:
"""Opaque handle to a `std::vector<kth::domain::chain::output_point>`."""
...
def chain_output_point_list_construct_default() -> OutputPointList: ...
def chain_output_point_list_push_back(list: OutputPointList, elem: OutputPoint) -> None: ...
def chain_output_point_list_destruct(list: OutputPointList) -> None: ...
def chain_output_point_list_count(list: OutputPointList) -> int: ...
def chain_output_point_list_nth(list: OutputPointList, index: int) -> OutputPoint: ...
def chain_output_point_list_assign_at(list: OutputPointList, index: int, elem: OutputPoint) -> None: ...
def chain_output_point_list_erase(list: OutputPointList, index: int) -> None: ...
# ─── Script (auto-generated, do not edit) ─────────────────────────
class Script:
"""Opaque handle to a `kth::domain::chain::script`. Constructed by
`chain_script_construct_*` and released by
`chain_script_destruct`."""
...
def chain_script_construct_default() -> Script: ...
def chain_script_construct_from_data(reader: bytes, wire: bool) -> Script: ...
def chain_script_construct_from_operations(ops: object) -> Script: ...
def chain_script_construct_from_encoded_prefix(encoded: bytes, prefix: bool) -> Script: ...
def chain_script_copy(self: Script) -> Script: ...
def chain_script_destruct(self: Script) -> None: ...
def chain_script_from_data_with_size(reader: bytes, size: int) -> "Script": ...
def chain_script_from_operations(self: Script, ops: object) -> None: ...
def chain_script_from_string(self: Script, mnemonic: str) -> bool: ...
def chain_script_is_valid_operations(self: Script) -> bool: ...
def chain_script_to_string(self: Script, active_flags: int) -> str | None: ...
def chain_script_clear(self: Script) -> None: ...
def chain_script_empty(self: Script) -> bool: ...
def chain_script_size(self: Script) -> int: ...
def chain_script_front(self: Script) -> "Operation" | None: ...
def chain_script_back(self: Script) -> "Operation" | None: ...
def chain_script_at(self: Script, index: int) -> "Operation" | None: ...
def chain_script_operations(self: Script) -> "OperationList" | None: ...
def chain_script_first_operation(self: Script) -> "Operation" | None: ...
def chain_script_create_endorsement(secret: bytes, prevout_script: "Script", tx: "Transaction", input_index: int, sighash_type: int, active_flags: int, value: int, type: int) -> bytes: ...
def chain_script_is_push_only(ops: object) -> bool: ...
def chain_script_is_relaxed_push(ops: object) -> bool: ...
def chain_script_is_coinbase_pattern(ops: object, height: int) -> bool: ...
def chain_script_is_null_data_pattern(ops: object) -> bool: ...
def chain_script_is_pay_multisig_pattern(ops: object) -> bool: ...
def chain_script_is_pay_public_key_pattern(ops: object) -> bool: ...
def chain_script_is_pay_public_key_hash_pattern(ops: object) -> bool: ...
def chain_script_is_pay_script_hash_pattern(ops: object) -> bool: ...
def chain_script_is_pay_script_hash_32_pattern(ops: object) -> bool: ...
def chain_script_is_sign_multisig_pattern(ops: object) -> bool: ...
def chain_script_is_sign_public_key_pattern(ops: object) -> bool: ...
def chain_script_is_sign_public_key_hash_pattern(ops: object) -> bool: ...
def chain_script_is_sign_script_hash_pattern(ops: object) -> bool: ...
def chain_script_to_null_data_pattern(data: bytes) -> "OperationList" | None: ...
def chain_script_to_pay_public_key_pattern(point: bytes) -> "OperationList" | None: ...
def chain_script_to_pay_public_key_hash_pattern(hash: bytes) -> "OperationList" | None: ...
def chain_script_to_pay_public_key_hash_pattern_unlocking(end: bytes, pubkey: "EcPublic") -> "OperationList" | None: ...
def chain_script_to_pay_public_key_hash_pattern_unlocking_placeholder(endorsement_size: int, pubkey_size: int) -> "OperationList" | None: ...
def chain_script_to_pay_script_hash_pattern_unlocking_placeholder(script_size: int, multisig: bool) -> "OperationList" | None: ...
def chain_script_to_pay_script_hash_pattern(hash: bytes) -> "OperationList" | None: ...
def chain_script_to_pay_script_hash_32_pattern(hash: bytes) -> "OperationList" | None: ...
def chain_script_to_pay_multisig_pattern_ec_compressed_list(signatures: int, points: object) -> "OperationList" | None: ...
def chain_script_to_pay_multisig_pattern_data_stack(signatures: int, points: object) -> "OperationList" | None: ...
def chain_script_pattern(self: Script) -> int: ...
def chain_script_output_pattern_simple(self: Script) -> int: ...
def chain_script_output_pattern(self: Script, flags: int) -> int: ...
def chain_script_input_pattern(self: Script) -> int: ...
def chain_script_sigops(self: Script, accurate: bool) -> int: ...
def chain_script_is_unspendable(self: Script) -> bool: ...
def chain_script_reset(self: Script) -> None: ...
def chain_script_is_pay_to_script_hash(self: Script, flags: int) -> bool: ...
def chain_script_is_pay_to_script_hash_32(self: Script, flags: int) -> bool: ...
def chain_script_verify(tx: "Transaction", input_index: int, flags: int, input_script: "Script", prevout_script: "Script", value: int) -> int: ...
def chain_script_verify_simple(tx: "Transaction", input: int, flags: int) -> int: ...
def chain_script_equals(self: Script, other: Script) -> bool: ...
def chain_script_is_valid(self: Script) -> bool: ...
def chain_script_to_data(self: Script, prefix: bool) -> bytes: ...
def chain_script_serialized_size(self: Script, prefix: bool) -> int: ...
def chain_script_bytes(self: Script) -> bytes: ...
def chain_script_is_enabled(active_flags: int, fork: int) -> bool: ...
# ─── Output (auto-generated, do not edit) ─────────────────────────
class Output:
"""Opaque handle to a `kth::domain::chain::output`. Constructed by
`chain_output_construct_*` and released by
`chain_output_destruct`."""
...
def chain_output_construct_default() -> Output: ...
def chain_output_construct_from_data(reader: bytes, wire: bool) -> Output: ...
def chain_output_copy(self: Output) -> Output: ...
def chain_output_destruct(self: Output) -> None: ...
def chain_output_to_data(self: Output, wire: bool) -> bytes: ...
def chain_output_serialized_size(self: Output, wire: bool) -> int: ...
def chain_output_set_script(self: Output, value: "Script") -> None: ...
def chain_output_address_simple(self: Output, testnet: bool) -> "PaymentAddress" | None: ...
def chain_output_address(self: Output, p2kh_version: int, p2sh_version: int) -> "PaymentAddress" | None: ...
def chain_output_addresses(self: Output, p2kh_version: int, p2sh_version: int) -> "PaymentAddressList" | None: ...
def chain_output_equals(self: Output, other: Output) -> bool: ...
def chain_output_is_valid(self: Output) -> bool: ...
def chain_output_value(self: Output) -> int: ...
def chain_output_set_value(self: Output, value: int) -> None: ...
def chain_output_script(self: Output) -> "Script" | None: ...
def chain_output_signature_operations(self: Output, bip141: bool) -> int: ...
def chain_output_is_dust(self: Output, minimum_output_value: int) -> bool: ...
def chain_output_reset(self: Output) -> None: ...
# ─── OutputList (auto-generated, do not edit) ─────────────────────────
class OutputList:
"""Opaque handle to a `std::vector<kth::domain::chain::output>`."""
...
def chain_output_list_construct_default() -> OutputList: ...
def chain_output_list_push_back(list: OutputList, elem: Output) -> None: ...
def chain_output_list_destruct(list: OutputList) -> None: ...
def chain_output_list_count(list: OutputList) -> int: ...
def chain_output_list_nth(list: OutputList, index: int) -> Output: ...
def chain_output_list_assign_at(list: OutputList, index: int, elem: Output) -> None: ...
def chain_output_list_erase(list: OutputList, index: int) -> None: ...
# ─── Input (auto-generated, do not edit) ─────────────────────────
class Input:
"""Opaque handle to a `kth::domain::chain::input`. Constructed by
`chain_input_construct_*` and released by
`chain_input_destruct`."""
...
def chain_input_construct_default() -> Input: ...
def chain_input_construct_from_data(reader: bytes, wire: bool) -> Input: ...
def chain_input_construct(previous_output: "OutputPoint", script: "Script", sequence: int) -> Input: ...
def chain_input_copy(self: Input) -> Input: ...
def chain_input_destruct(self: Input) -> None: ...
def chain_input_set_script(self: Input, value: "Script") -> None: ...
def chain_input_address(self: Input) -> "PaymentAddress" | None: ...
def chain_input_addresses(self: Input) -> "PaymentAddressList" | None: ...
def chain_input_reset(self: Input) -> None: ...
def chain_input_equals(self: Input, other: Input) -> bool: ...
def chain_input_is_valid(self: Input) -> bool: ...
def chain_input_to_data(self: Input, wire: bool) -> bytes: ...
def chain_input_serialized_size(self: Input, wire: bool) -> int: ...
def chain_input_previous_output(self: Input) -> "OutputPoint" | None: ...
def chain_input_set_previous_output(self: Input, value: "OutputPoint") -> None: ...
def chain_input_script(self: Input) -> "Script" | None: ...
def chain_input_sequence(self: Input) -> int: ...
def chain_input_set_sequence(self: Input, value: int) -> None: ...
def chain_input_is_final(self: Input) -> bool: ...
def chain_input_is_locked(self: Input, block_height: int, median_time_past: int) -> bool: ...
def chain_input_signature_operations(self: Input, bip16: bool, bip141: bool) -> int: ...
def chain_input_extract_embedded_script(self: Input) -> "Script": ...
# ─── InputList (auto-generated, do not edit) ─────────────────────────
class InputList:
"""Opaque handle to a `std::vector<kth::domain::chain::input>`."""
...
def chain_input_list_construct_default() -> InputList: ...
def chain_input_list_push_back(list: InputList, elem: Input) -> None: ...
def chain_input_list_destruct(list: InputList) -> None: ...
def chain_input_list_count(list: InputList) -> int: ...
def chain_input_list_nth(list: InputList, index: int) -> Input: ...
def chain_input_list_assign_at(list: InputList, index: int, elem: Input) -> None: ...
def chain_input_list_erase(list: InputList, index: int) -> None: ...
# ─── Transaction (auto-generated, do not edit) ─────────────────────────
class Transaction:
"""Opaque handle to a `kth::domain::chain::transaction`. Constructed by
`chain_transaction_construct_*` and released by
`chain_transaction_destruct`."""
...
def chain_transaction_construct_default() -> Transaction: ...
def chain_transaction_construct_from_data(reader: bytes, wire: bool) -> Transaction: ...
def chain_transaction_construct_from_version_locktime_inputs_outputs(version: int, locktime: int, inputs: object, outputs: object) -> Transaction: ...
def chain_transaction_construct_from_transaction_hash(x: "Transaction", hash: bytes) -> Transaction: ...
def chain_transaction_copy(self: Transaction) -> Transaction: ...
def chain_transaction_destruct(self: Transaction) -> None: ...
def chain_transaction_to_data(self: Transaction, wire: bool) -> bytes: ...
def chain_transaction_serialized_size(self: Transaction, wire: bool) -> int: ...
def chain_transaction_set_version(self: Transaction, value: int) -> None: ...
def chain_transaction_set_locktime(self: Transaction, value: int) -> None: ...
def chain_transaction_set_inputs(self: Transaction, value: object) -> None: ...
def chain_transaction_set_outputs(self: Transaction, value: object) -> None: ...
def chain_transaction_outputs_hash(self: Transaction) -> bytes: ...
def chain_transaction_inpoints_hash(self: Transaction) -> bytes: ...
def chain_transaction_sequences_hash(self: Transaction) -> bytes: ...
def chain_transaction_utxos_hash(self: Transaction) -> bytes: ...
def chain_transaction_hash(self: Transaction) -> bytes: ...
def chain_transaction_recompute_hash(self: Transaction) -> None: ...
def chain_transaction_fees(self: Transaction) -> int: ...
def chain_transaction_total_input_value(self: Transaction) -> int: ...
def chain_transaction_total_output_value(self: Transaction) -> int: ...
def chain_transaction_signature_operations_simple(self: Transaction) -> int: ...
def chain_transaction_is_overspent(self: Transaction) -> bool: ...
def chain_transaction_check(self: Transaction, max_block_size: int, transaction_pool: bool, retarget: bool) -> int: ...
def chain_transaction_accept(self: Transaction, flags: int, height: int, median_time_past: int, max_sigops: int, is_under_checkpoint: bool, transaction_pool: bool) -> int: ...
def chain_transaction_connect_simple(self: Transaction) -> int: ...
def chain_transaction_connect(self: Transaction, state: "ChainState") -> int: ...
def chain_transaction_connect_input(self: Transaction, state: "ChainState", input_index: int) -> int: ...
def chain_transaction_reset(self: Transaction) -> None: ...
def chain_transaction_equals(self: Transaction, other: Transaction) -> bool: ...
def chain_transaction_is_valid(self: Transaction) -> bool: ...
def chain_transaction_version(self: Transaction) -> int: ...
def chain_transaction_locktime(self: Transaction) -> int: ...
def chain_transaction_inputs(self: Transaction) -> "InputList" | None: ...
def chain_transaction_outputs(self: Transaction) -> "OutputList" | None: ...
def chain_transaction_previous_outputs(self: Transaction) -> "PointList" | None: ...
def chain_transaction_missing_previous_outputs(self: Transaction) -> "PointList" | None: ...
def chain_transaction_missing_previous_transactions(self: Transaction) -> object | None: ...
def chain_transaction_signature_operations(self: Transaction, bip16: bool, bip141: bool) -> int: ...
def chain_transaction_is_coinbase(self: Transaction) -> bool: ...
def chain_transaction_is_null_non_coinbase(self: Transaction) -> bool: ...
def chain_transaction_is_oversized_coinbase(self: Transaction) -> bool: ...
def chain_transaction_is_mature(self: Transaction, height: int) -> bool: ...
def chain_transaction_is_internal_double_spend(self: Transaction) -> bool: ...
def chain_transaction_is_double_spend(self: Transaction, include_unconfirmed: bool) -> bool: ...
def chain_transaction_is_dusty(self: Transaction, minimum_output_value: int) -> bool: ...
def chain_transaction_is_missing_previous_outputs(self: Transaction) -> bool: ...
def chain_transaction_is_final(self: Transaction, block_height: int, block_time: int) -> bool: ...
def chain_transaction_is_locked(self: Transaction, block_height: int, median_time_past: int) -> bool: ...
def chain_transaction_is_locktime_conflict(self: Transaction) -> bool: ...
def chain_transaction_min_tx_size(self: Transaction, flags: int) -> int: ...
def chain_transaction_is_standard_simple(self: Transaction) -> bool: ...
def chain_transaction_is_standard(self: Transaction, flags: int) -> bool: ...
# ─── TransactionList (auto-generated, do not edit) ─────────────────────────
class TransactionList:
"""Opaque handle to a `std::vector<kth::domain::chain::transaction>`."""
...
def chain_transaction_list_construct_default() -> TransactionList: ...
def chain_transaction_list_push_back(list: TransactionList, elem: Transaction) -> None: ...
def chain_transaction_list_destruct(list: TransactionList) -> None: ...
def chain_transaction_list_count(list: TransactionList) -> int: ...
def chain_transaction_list_nth(list: TransactionList, index: int) -> Transaction: ...
def chain_transaction_list_assign_at(list: TransactionList, index: int, elem: Transaction) -> None: ...
def chain_transaction_list_erase(list: TransactionList, index: int) -> None: ...
# ─── Binary (auto-generated, do not edit) ─────────────────────────
class Binary:
"""Opaque handle to a `kth::binary`. Constructed by
`core_binary_construct_*` and released by
`core_binary_destruct`."""
...
def core_binary_construct_default() -> Binary: ...
def core_binary_construct_from_bit_string(bit_string: str) -> Binary: ...
def core_binary_construct_from_size_number(size: int, number: int) -> Binary: ...
def core_binary_construct_from_size_blocks(size: int, blocks: bytes) -> Binary: ...
def core_binary_copy(self: Binary) -> Binary: ...
def core_binary_destruct(self: Binary) -> None: ...
def core_binary_blocks_size(bit_size: int) -> int: ...
def core_binary_is_base2(text: str) -> bool: ...
def core_binary_resize(self: Binary, size: int) -> None: ...
def core_binary_at(self: Binary, index: int) -> bool: ...
def core_binary_blocks(self: Binary) -> bytes: ...
def core_binary_encoded(self: Binary) -> str | None: ...
def core_binary_size(self: Binary) -> int: ...
def core_binary_append(self: Binary, post: "Binary") -> None: ...
def core_binary_prepend(self: Binary, prior: "Binary") -> None: ...
def core_binary_shift_left(self: Binary, distance: int) -> None: ...
def core_binary_shift_right(self: Binary, distance: int) -> None: ...
def core_binary_substring(self: Binary, start: int, length: int) -> "Binary" | None: ...
def core_binary_is_prefix_of_span(self: Binary, field: bytes) -> bool: ...
def core_binary_is_prefix_of_uint32(self: Binary, field: int) -> bool: ...
def core_binary_is_prefix_of_binary(self: Binary, field: "Binary") -> bool: ...
def core_binary_equals(self: Binary, other: Binary) -> bool: ...
def core_binary_less(self: Binary, x: "Binary") -> bool: ...
# ─── GetBlocks (auto-generated, do not edit) ─────────────────────────
class GetBlocks:
"""Opaque handle to a `kth::domain::message::get_blocks`. Constructed by
`chain_get_blocks_construct_*` and released by
`chain_get_blocks_destruct`."""
...
def chain_get_blocks_construct_default() -> GetBlocks: ...
def chain_get_blocks_construct_from_data(reader: bytes, version: int) -> GetBlocks: ...
def chain_get_blocks_construct(start: object, stop: bytes) -> GetBlocks: ...
def chain_get_blocks_copy(self: GetBlocks) -> GetBlocks: ...
def chain_get_blocks_destruct(self: GetBlocks) -> None: ...
def chain_get_blocks_equals(self: GetBlocks, other: GetBlocks) -> bool: ...
def chain_get_blocks_start_hashes(self: GetBlocks) -> object | None: ...
def chain_get_blocks_set_start_hashes(self: GetBlocks, value: object) -> None: ...
def chain_get_blocks_stop_hash(self: GetBlocks) -> bytes: ...
def chain_get_blocks_set_stop_hash(self: GetBlocks, value: bytes) -> None: ...
def chain_get_blocks_to_data(self: GetBlocks, version: int) -> bytes: ...
def chain_get_blocks_is_valid(self: GetBlocks) -> bool: ...
def chain_get_blocks_reset(self: GetBlocks) -> None: ...
def chain_get_blocks_serialized_size(self: GetBlocks, version: int) -> int: ...
# ─── GetHeaders (auto-generated, do not edit) ─────────────────────────
class GetHeaders:
"""Opaque handle to a `kth::domain::message::get_headers`. Constructed by
`chain_get_headers_construct_*` and released by
`chain_get_headers_destruct`."""
...
def chain_get_headers_construct_default() -> GetHeaders: ...
def chain_get_headers_construct_from_data(reader: bytes, version: int) -> GetHeaders: ...
def chain_get_headers_construct(start: object, stop: bytes) -> GetHeaders: ...
def chain_get_headers_copy(self: GetHeaders) -> GetHeaders: ...
def chain_get_headers_destruct(self: GetHeaders) -> None: ...
def chain_get_headers_equals(self: GetHeaders, other: GetHeaders) -> bool: ...
def chain_get_headers_start_hashes(self: GetHeaders) -> object | None: ...
def chain_get_headers_set_start_hashes(self: GetHeaders, value: object) -> None: ...
def chain_get_headers_stop_hash(self: GetHeaders) -> bytes: ...
def chain_get_headers_set_stop_hash(self: GetHeaders, value: bytes) -> None: ...
def chain_get_headers_to_data(self: GetHeaders, version: int) -> bytes: ...
def chain_get_headers_is_valid(self: GetHeaders) -> bool: ...
def chain_get_headers_reset(self: GetHeaders) -> None: ...
def chain_get_headers_serialized_size(self: GetHeaders, version: int) -> int: ...
# ─── MerkleBlock (auto-generated, do not edit) ─────────────────────────
class MerkleBlock:
"""Opaque handle to a `kth::domain::message::merkle_block`. Constructed by
`chain_merkle_block_construct_*` and released by
`chain_merkle_block_destruct`."""
...
def chain_merkle_block_construct_default() -> MerkleBlock: ...
def chain_merkle_block_construct_from_data(reader: bytes, version: int) -> MerkleBlock: ...
def chain_merkle_block_construct_from_header_total_transactions_hashes_flags(header: "Header", total_transactions: int, hashes: object, flags: bytes) -> MerkleBlock: ...
def chain_merkle_block_construct_from_block(block: "Block") -> MerkleBlock: ...
def chain_merkle_block_copy(self: MerkleBlock) -> MerkleBlock: ...
def chain_merkle_block_destruct(self: MerkleBlock) -> None: ...
def chain_merkle_block_equals(self: MerkleBlock, other: MerkleBlock) -> bool: ...
def chain_merkle_block_header(self: MerkleBlock) -> "Header" | None: ...
def chain_merkle_block_set_header(self: MerkleBlock, value: "Header") -> None: ...
def chain_merkle_block_total_transactions(self: MerkleBlock) -> int: ...
def chain_merkle_block_set_total_transactions(self: MerkleBlock, value: int) -> None: ...
def chain_merkle_block_hashes(self: MerkleBlock) -> object | None: ...
def chain_merkle_block_set_hashes(self: MerkleBlock, value: object) -> None: ...
def chain_merkle_block_flags(self: MerkleBlock) -> bytes: ...
def chain_merkle_block_set_flags(self: MerkleBlock, value: bytes) -> None: ...
def chain_merkle_block_to_data(self: MerkleBlock, version: int) -> bytes: ...
def chain_merkle_block_is_valid(self: MerkleBlock) -> bool: ...
def chain_merkle_block_reset(self: MerkleBlock) -> None: ...
def chain_merkle_block_serialized_size(self: MerkleBlock, version: int) -> int: ...
# ─── PrefilledTransaction (auto-generated, do not edit) ─────────────────────────