From aca3623478ddb42c8ab039725a807634daf7e07a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 24 Oct 2024 22:39:04 -0400 Subject: [PATCH 1/7] hint `.to_json_dict()` better --- wheel/generate_type_stubs.py | 3 +- wheel/python/chia_rs/chia_rs.pyi | 239 ++++++++++++++++--------------- wheel/stubtest.allowlist | 4 + 3 files changed, 126 insertions(+), 120 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 9d9f2cc02..1ed287483 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -67,7 +67,7 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... """ @@ -267,6 +267,7 @@ def parse_rust_source(filename: str, upper_case: bool) -> list[tuple[str, list[s from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram +Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index bbefde155..1eaa9f053 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -9,6 +9,7 @@ from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram +Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: @@ -160,7 +161,7 @@ class G1Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -191,7 +192,7 @@ class G2Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -218,7 +219,7 @@ class GTElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -250,7 +251,7 @@ class PrivateKey: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -311,7 +312,7 @@ class SpendConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_id: Union[ bytes, _Unspec] = _Unspec(), @@ -375,7 +376,7 @@ class SpendBundleConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, spends: Union[ list[SpendConditions], _Unspec] = _Unspec(), @@ -467,7 +468,7 @@ class BlockRecord: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -521,7 +522,7 @@ class Message: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, msg_type: Union[ int, _Unspec] = _Unspec(), @@ -559,7 +560,7 @@ class Handshake: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, network_id: Union[ str, _Unspec] = _Unspec(), @@ -596,7 +597,7 @@ class ClassgroupElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, data: Union[ bytes100, _Unspec] = _Unspec()) -> ClassgroupElement: ... @@ -627,7 +628,7 @@ class Coin: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, parent_coin_info: Union[ bytes32, _Unspec] = _Unspec(), @@ -659,7 +660,7 @@ class CoinSpend: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), @@ -691,7 +692,7 @@ class CoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), @@ -725,7 +726,7 @@ class EndOfSubSlotBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_chain: Union[ ChallengeChainSubSlot, _Unspec] = _Unspec(), @@ -754,7 +755,7 @@ class FeeRate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, mojos_per_clvm_cost: Union[ uint64, _Unspec] = _Unspec()) -> FeeRate: ... @@ -784,7 +785,7 @@ class FeeEstimate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), @@ -814,7 +815,7 @@ class FeeEstimateGroup: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), @@ -851,7 +852,7 @@ class TransactionsInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, generator_root: Union[ bytes32, _Unspec] = _Unspec(), @@ -892,7 +893,7 @@ class FoliageTransactionBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_transaction_block_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -931,7 +932,7 @@ class FoliageBlockData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_block_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -971,7 +972,7 @@ class Foliage: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_block_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1010,7 +1011,7 @@ class NewPeak: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1044,7 +1045,7 @@ class NewTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec(), @@ -1072,7 +1073,7 @@ class RequestTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec()) -> RequestTransaction: ... @@ -1098,7 +1099,7 @@ class RespondTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> RespondTransaction: ... @@ -1126,7 +1127,7 @@ class RequestProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, total_number_of_blocks: Union[ uint32, _Unspec] = _Unspec(), @@ -1155,7 +1156,7 @@ class RespondProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, wp: Union[ WeightProof, _Unspec] = _Unspec(), @@ -1184,7 +1185,7 @@ class RequestBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1211,7 +1212,7 @@ class RejectBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlock: ... @@ -1241,7 +1242,7 @@ class RequestBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -1273,7 +1274,7 @@ class RespondBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -1303,7 +1304,7 @@ class RejectBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -1330,7 +1331,7 @@ class RespondBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, block: Union[ FullBlock, _Unspec] = _Unspec()) -> RespondBlock: ... @@ -1356,7 +1357,7 @@ class NewUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> NewUnfinishedBlock: ... @@ -1382,7 +1383,7 @@ class RequestUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RequestUnfinishedBlock: ... @@ -1408,7 +1409,7 @@ class RespondUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_block: Union[ UnfinishedBlock, _Unspec] = _Unspec()) -> RespondUnfinishedBlock: ... @@ -1440,7 +1441,7 @@ class NewSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_challenge_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -1473,7 +1474,7 @@ class RequestSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1509,7 +1510,7 @@ class RespondSignagePoint: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), @@ -1539,7 +1540,7 @@ class RespondEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, end_of_slot_bundle: Union[ EndOfSubSlotBundle, _Unspec] = _Unspec()) -> RespondEndOfSubSlot: ... @@ -1565,7 +1566,7 @@ class RequestMempoolTransactions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, filter: Union[ bytes, _Unspec] = _Unspec()) -> RequestMempoolTransactions: ... @@ -1597,7 +1598,7 @@ class NewCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1632,7 +1633,7 @@ class RequestCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1669,7 +1670,7 @@ class RespondCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -1697,7 +1698,7 @@ class RequestPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -1722,7 +1723,7 @@ class RespondPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, peer_list: Union[ list[TimestampedPeerInfo], _Unspec] = _Unspec()) -> RespondPeers: ... @@ -1750,7 +1751,7 @@ class NewUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1779,7 +1780,7 @@ class RequestUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -1836,7 +1837,7 @@ class FullBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -1902,7 +1903,7 @@ class HeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -1942,7 +1943,7 @@ class TimestampedPeerInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, host: Union[ str, _Unspec] = _Unspec(), @@ -1972,7 +1973,7 @@ class PoolTarget: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2013,7 +2014,7 @@ class Program: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... @@ -2048,7 +2049,7 @@ class ProofOfSpace: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), @@ -2093,7 +2094,7 @@ class RewardChainBlockUnfinished: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, total_iters: Union[ uint128, _Unspec] = _Unspec(), @@ -2153,7 +2154,7 @@ class RewardChainBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, weight: Union[ uint128, _Unspec] = _Unspec(), @@ -2198,7 +2199,7 @@ class ChallengeBlockInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, proof_of_space: Union[ ProofOfSpace, _Unspec] = _Unspec(), @@ -2235,7 +2236,7 @@ class ChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), @@ -2265,7 +2266,7 @@ class InfusedChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, infused_challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec()) -> InfusedChallengeChainSubSlot: ... @@ -2297,7 +2298,7 @@ class RewardChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), @@ -2330,7 +2331,7 @@ class SubSlotProofs: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_chain_slot_proof: Union[ VDFProof, _Unspec] = _Unspec(), @@ -2365,7 +2366,7 @@ class SpendBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_spends: Union[ list[CoinSpend], _Unspec] = _Unspec(), @@ -2400,7 +2401,7 @@ class SubEpochSummary: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, prev_subepoch_summary_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2450,7 +2451,7 @@ class UnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -2499,7 +2500,7 @@ class UnfinishedHeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -2535,7 +2536,7 @@ class VDFInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), @@ -2567,7 +2568,7 @@ class VDFProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, witness_type: Union[ uint8, _Unspec] = _Unspec(), @@ -2597,7 +2598,7 @@ class RequestPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), @@ -2630,7 +2631,7 @@ class PuzzleSolutionResponse: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), @@ -2659,7 +2660,7 @@ class RespondPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, response: Union[ PuzzleSolutionResponse, _Unspec] = _Unspec()) -> RespondPuzzleSolution: ... @@ -2687,7 +2688,7 @@ class RejectPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), @@ -2714,7 +2715,7 @@ class SendTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> SendTransaction: ... @@ -2744,7 +2745,7 @@ class TransactionAck: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, txid: Union[ bytes32, _Unspec] = _Unspec(), @@ -2778,7 +2779,7 @@ class NewPeakWallet: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2807,7 +2808,7 @@ class RequestBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RequestBlockHeader: ... @@ -2833,7 +2834,7 @@ class RespondBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, header_block: Union[ HeaderBlock, _Unspec] = _Unspec()) -> RespondBlockHeader: ... @@ -2859,7 +2860,7 @@ class RejectHeaderRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectHeaderRequest: ... @@ -2889,7 +2890,7 @@ class RequestRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -2923,7 +2924,7 @@ class RespondRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -2954,7 +2955,7 @@ class RejectRemovalsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -2985,7 +2986,7 @@ class RequestAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3019,7 +3020,7 @@ class RespondAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3050,7 +3051,7 @@ class RejectAdditionsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3081,7 +3082,7 @@ class RespondBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3111,7 +3112,7 @@ class RejectBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3142,7 +3143,7 @@ class RequestBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3172,7 +3173,7 @@ class RequestHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3201,7 +3202,7 @@ class RejectHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3232,7 +3233,7 @@ class RespondHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3262,7 +3263,7 @@ class RegisterForPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3293,7 +3294,7 @@ class RespondToPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3323,7 +3324,7 @@ class RegisterForCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3354,7 +3355,7 @@ class RespondToCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3388,7 +3389,7 @@ class CoinStateUpdate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), @@ -3417,7 +3418,7 @@ class RequestChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec()) -> RequestChildren: ... @@ -3443,7 +3444,7 @@ class RespondChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondChildren: ... @@ -3471,7 +3472,7 @@ class RequestSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), @@ -3500,7 +3501,7 @@ class RespondSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reward_chain_hash: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3527,7 +3528,7 @@ class RequestFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, time_targets: Union[ list[uint64], _Unspec] = _Unspec()) -> RequestFeeEstimates: ... @@ -3553,7 +3554,7 @@ class RespondFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, estimates: Union[ FeeEstimateGroup, _Unspec] = _Unspec()) -> RespondFeeEstimates: ... @@ -3579,7 +3580,7 @@ class RequestRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovePuzzleSubscriptions: ... @@ -3605,7 +3606,7 @@ class RespondRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemovePuzzleSubscriptions: ... @@ -3631,7 +3632,7 @@ class RequestRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemoveCoinSubscriptions: ... @@ -3657,7 +3658,7 @@ class RespondRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemoveCoinSubscriptions: ... @@ -3689,7 +3690,7 @@ class CoinStateFilters: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, include_spent: Union[ bool, _Unspec] = _Unspec(), @@ -3726,7 +3727,7 @@ class RequestPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3764,7 +3765,7 @@ class RespondPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3794,7 +3795,7 @@ class RejectPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectPuzzleState: ... @@ -3826,7 +3827,7 @@ class RequestCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3857,7 +3858,7 @@ class RespondCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), @@ -3884,7 +3885,7 @@ class RejectCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectCoinState: ... @@ -3916,7 +3917,7 @@ class SubEpochData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, reward_chain_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3971,7 +3972,7 @@ class SubSlotData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, proof_of_space: Union[ Optional[ProofOfSpace], _Unspec] = _Unspec(), @@ -4013,7 +4014,7 @@ class SubEpochChallengeSegment: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, sub_epoch_n: Union[ uint32, _Unspec] = _Unspec(), @@ -4041,7 +4042,7 @@ class SubEpochSegments: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, challenge_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec()) -> SubEpochSegments: ... @@ -4067,7 +4068,7 @@ class RecentChainData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RecentChainData: ... @@ -4095,7 +4096,7 @@ class ProofBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), @@ -4126,7 +4127,7 @@ class WeightProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, sub_epochs: Union[ list[SubEpochData], _Unspec] = _Unspec(), @@ -4244,7 +4245,7 @@ class ConsensusConstants: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Any: ... + def to_json_dict(self) -> Json: ... @classmethod def from_json_dict(cls, json_dict: Any) -> Self: ... def replace(self, *, SLOT_BLOCKS_TARGET: Union[ uint32, _Unspec] = _Unspec(), diff --git a/wheel/stubtest.allowlist b/wheel/stubtest.allowlist index 0da900bc1..77420a8f4 100644 --- a/wheel/stubtest.allowlist +++ b/wheel/stubtest.allowlist @@ -7,6 +7,10 @@ chia_rs\.chia_rs\..* # runtime accessible. is there a better option for handling this? chia_rs\.ReadableBuffer +# this is offered to help with hinting only and is not intended to be +# runtime accessible. is there a better option for handling this? +chia_rs\.Json + # TODO: perhaps these should be private as _* chia_rs\.BlockRecord\.ip_iters_impl chia_rs\.BlockRecord\.ip_sub_slot_total_iters_impl From aca98183aafd177d433e3e7ed34364cfaf9ce584 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 09:10:08 -0400 Subject: [PATCH 2/7] dict[str, Any] --- wheel/generate_type_stubs.py | 5 +- wheel/python/chia_rs/chia_rs.pyi | 477 +++++++++++++++---------------- wheel/stubtest.allowlist | 4 - 3 files changed, 240 insertions(+), 246 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 1ed287483..33262a7e5 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -67,9 +67,9 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... """ ) @@ -267,7 +267,6 @@ def parse_rust_source(filename: str, upper_case: bool) -> list[tuple[str, list[s from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram -Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 1eaa9f053..0209dd864 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -9,7 +9,6 @@ from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int from typing_extensions import Self from chia.types.blockchain_format.program import Program as ChiaProgram -Json = Union[str, bool, int, float, list["Json"], dict[str, "Json"]] ReadableBuffer = Union[bytes, bytearray, memoryview] class _Unspec: @@ -161,9 +160,9 @@ class G1Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class G2Element: @@ -192,9 +191,9 @@ class G2Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class GTElement: @@ -219,9 +218,9 @@ class GTElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class PrivateKey: @@ -251,9 +250,9 @@ class PrivateKey: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class SpendConditions: @@ -312,9 +311,9 @@ class SpendConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_id: Union[ bytes, _Unspec] = _Unspec(), parent_id: Union[ bytes, _Unspec] = _Unspec(), puzzle_hash: Union[ bytes, _Unspec] = _Unspec(), @@ -376,9 +375,9 @@ class SpendBundleConditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, spends: Union[ list[SpendConditions], _Unspec] = _Unspec(), reserve_fee: Union[ int, _Unspec] = _Unspec(), height_absolute: Union[ int, _Unspec] = _Unspec(), @@ -468,9 +467,9 @@ class BlockRecord: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), prev_hash: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), @@ -522,9 +521,9 @@ class Message: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, msg_type: Union[ int, _Unspec] = _Unspec(), id: Union[ Optional[uint16], _Unspec] = _Unspec(), data: Union[ bytes, _Unspec] = _Unspec()) -> Message: ... @@ -560,9 +559,9 @@ class Handshake: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, network_id: Union[ str, _Unspec] = _Unspec(), protocol_version: Union[ str, _Unspec] = _Unspec(), software_version: Union[ str, _Unspec] = _Unspec(), @@ -597,9 +596,9 @@ class ClassgroupElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, data: Union[ bytes100, _Unspec] = _Unspec()) -> ClassgroupElement: ... @final @@ -628,9 +627,9 @@ class Coin: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, parent_coin_info: Union[ bytes32, _Unspec] = _Unspec(), puzzle_hash: Union[ bytes32, _Unspec] = _Unspec(), amount: Union[ uint64, _Unspec] = _Unspec()) -> Coin: ... @@ -660,9 +659,9 @@ class CoinSpend: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), puzzle_reveal: Union[ Program, _Unspec] = _Unspec(), solution: Union[ Program, _Unspec] = _Unspec()) -> CoinSpend: ... @@ -692,9 +691,9 @@ class CoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin: Union[ Coin, _Unspec] = _Unspec(), spent_height: Union[ Optional[uint32], _Unspec] = _Unspec(), created_height: Union[ Optional[uint32], _Unspec] = _Unspec()) -> CoinState: ... @@ -726,9 +725,9 @@ class EndOfSubSlotBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_chain: Union[ ChallengeChainSubSlot, _Unspec] = _Unspec(), infused_challenge_chain: Union[ Optional[InfusedChallengeChainSubSlot], _Unspec] = _Unspec(), reward_chain: Union[ RewardChainSubSlot, _Unspec] = _Unspec(), @@ -755,9 +754,9 @@ class FeeRate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, mojos_per_clvm_cost: Union[ uint64, _Unspec] = _Unspec()) -> FeeRate: ... @final @@ -785,9 +784,9 @@ class FeeEstimate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), time_target: Union[ uint64, _Unspec] = _Unspec(), estimated_fee_rate: Union[ FeeRate, _Unspec] = _Unspec()) -> FeeEstimate: ... @@ -815,9 +814,9 @@ class FeeEstimateGroup: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, error: Union[ Optional[str], _Unspec] = _Unspec(), estimates: Union[ list[FeeEstimate], _Unspec] = _Unspec()) -> FeeEstimateGroup: ... @@ -852,9 +851,9 @@ class TransactionsInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, generator_root: Union[ bytes32, _Unspec] = _Unspec(), generator_refs_root: Union[ bytes32, _Unspec] = _Unspec(), aggregated_signature: Union[ G2Element, _Unspec] = _Unspec(), @@ -893,9 +892,9 @@ class FoliageTransactionBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_transaction_block_hash: Union[ bytes32, _Unspec] = _Unspec(), timestamp: Union[ uint64, _Unspec] = _Unspec(), filter_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -932,9 +931,9 @@ class FoliageBlockData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_block_hash: Union[ bytes32, _Unspec] = _Unspec(), pool_target: Union[ PoolTarget, _Unspec] = _Unspec(), pool_signature: Union[ Optional[G2Element], _Unspec] = _Unspec(), @@ -972,9 +971,9 @@ class Foliage: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_block_hash: Union[ bytes32, _Unspec] = _Unspec(), reward_block_hash: Union[ bytes32, _Unspec] = _Unspec(), foliage_block_data: Union[ FoliageBlockData, _Unspec] = _Unspec(), @@ -1011,9 +1010,9 @@ class NewPeak: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), weight: Union[ uint128, _Unspec] = _Unspec(), @@ -1045,9 +1044,9 @@ class NewTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec(), cost: Union[ uint64, _Unspec] = _Unspec(), fees: Union[ uint64, _Unspec] = _Unspec()) -> NewTransaction: ... @@ -1073,9 +1072,9 @@ class RequestTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction_id: Union[ bytes32, _Unspec] = _Unspec()) -> RequestTransaction: ... @final @@ -1099,9 +1098,9 @@ class RespondTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> RespondTransaction: ... @final @@ -1127,9 +1126,9 @@ class RequestProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, total_number_of_blocks: Union[ uint32, _Unspec] = _Unspec(), tip: Union[ bytes32, _Unspec] = _Unspec()) -> RequestProofOfWeight: ... @@ -1156,9 +1155,9 @@ class RespondProofOfWeight: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, wp: Union[ WeightProof, _Unspec] = _Unspec(), tip: Union[ bytes32, _Unspec] = _Unspec()) -> RespondProofOfWeight: ... @@ -1185,9 +1184,9 @@ class RequestBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), include_transaction_block: Union[ bool, _Unspec] = _Unspec()) -> RequestBlock: ... @@ -1212,9 +1211,9 @@ class RejectBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlock: ... @final @@ -1242,9 +1241,9 @@ class RequestBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), include_transaction_block: Union[ bool, _Unspec] = _Unspec()) -> RequestBlocks: ... @@ -1274,9 +1273,9 @@ class RespondBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), blocks: Union[ list[FullBlock], _Unspec] = _Unspec()) -> RespondBlocks: ... @@ -1304,9 +1303,9 @@ class RejectBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlocks: ... @@ -1331,9 +1330,9 @@ class RespondBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, block: Union[ FullBlock, _Unspec] = _Unspec()) -> RespondBlock: ... @final @@ -1357,9 +1356,9 @@ class NewUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> NewUnfinishedBlock: ... @final @@ -1383,9 +1382,9 @@ class RequestUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RequestUnfinishedBlock: ... @final @@ -1409,9 +1408,9 @@ class RespondUnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_block: Union[ UnfinishedBlock, _Unspec] = _Unspec()) -> RespondUnfinishedBlock: ... @final @@ -1441,9 +1440,9 @@ class NewSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_challenge_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), @@ -1474,9 +1473,9 @@ class RequestSignagePointOrEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), last_rc_infusion: Union[ bytes32, _Unspec] = _Unspec()) -> RequestSignagePointOrEndOfSubSlot: ... @@ -1510,9 +1509,9 @@ class RespondSignagePoint: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, index_from_challenge: Union[ uint8, _Unspec] = _Unspec(), challenge_chain_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), challenge_chain_proof: Union[ VDFProof, _Unspec] = _Unspec(), @@ -1540,9 +1539,9 @@ class RespondEndOfSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, end_of_slot_bundle: Union[ EndOfSubSlotBundle, _Unspec] = _Unspec()) -> RespondEndOfSubSlot: ... @final @@ -1566,9 +1565,9 @@ class RequestMempoolTransactions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, filter: Union[ bytes, _Unspec] = _Unspec()) -> RequestMempoolTransactions: ... @final @@ -1598,9 +1597,9 @@ class NewCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), field_vdf: Union[ uint8, _Unspec] = _Unspec(), @@ -1633,9 +1632,9 @@ class RequestCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), field_vdf: Union[ uint8, _Unspec] = _Unspec(), @@ -1670,9 +1669,9 @@ class RespondCompactVDF: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), field_vdf: Union[ uint8, _Unspec] = _Unspec(), @@ -1698,9 +1697,9 @@ class RequestPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class RespondPeers: @@ -1723,9 +1722,9 @@ class RespondPeers: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, peer_list: Union[ list[TimestampedPeerInfo], _Unspec] = _Unspec()) -> RespondPeers: ... @final @@ -1751,9 +1750,9 @@ class NewUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), foliage_hash: Union[ Optional[bytes32], _Unspec] = _Unspec()) -> NewUnfinishedBlock2: ... @@ -1780,9 +1779,9 @@ class RequestUnfinishedBlock2: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, unfinished_reward_hash: Union[ bytes32, _Unspec] = _Unspec(), foliage_hash: Union[ Optional[bytes32], _Unspec] = _Unspec()) -> RequestUnfinishedBlock2: ... @@ -1837,9 +1836,9 @@ class FullBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -1903,9 +1902,9 @@ class HeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -1943,9 +1942,9 @@ class TimestampedPeerInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, host: Union[ str, _Unspec] = _Unspec(), port: Union[ uint16, _Unspec] = _Unspec(), timestamp: Union[ uint64, _Unspec] = _Unspec()) -> TimestampedPeerInfo: ... @@ -1973,9 +1972,9 @@ class PoolTarget: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hash: Union[ bytes32, _Unspec] = _Unspec(), max_height: Union[ uint32, _Unspec] = _Unspec()) -> PoolTarget: ... @@ -2014,9 +2013,9 @@ class Program: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... @final class ProofOfSpace: @@ -2049,9 +2048,9 @@ class ProofOfSpace: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), pool_public_key: Union[ Optional[G1Element], _Unspec] = _Unspec(), pool_contract_puzzle_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -2094,9 +2093,9 @@ class RewardChainBlockUnfinished: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, total_iters: Union[ uint128, _Unspec] = _Unspec(), signage_point_index: Union[ uint8, _Unspec] = _Unspec(), pos_ss_cc_challenge_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -2154,9 +2153,9 @@ class RewardChainBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, weight: Union[ uint128, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), total_iters: Union[ uint128, _Unspec] = _Unspec(), @@ -2199,9 +2198,9 @@ class ChallengeBlockInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, proof_of_space: Union[ ProofOfSpace, _Unspec] = _Unspec(), challenge_chain_sp_vdf: Union[ Optional[VDFInfo], _Unspec] = _Unspec(), challenge_chain_sp_signature: Union[ G2Element, _Unspec] = _Unspec(), @@ -2236,9 +2235,9 @@ class ChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), infused_challenge_chain_sub_slot_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), subepoch_summary_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -2266,9 +2265,9 @@ class InfusedChallengeChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, infused_challenge_chain_end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec()) -> InfusedChallengeChainSubSlot: ... @final @@ -2298,9 +2297,9 @@ class RewardChainSubSlot: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, end_of_slot_vdf: Union[ VDFInfo, _Unspec] = _Unspec(), challenge_chain_sub_slot_hash: Union[ bytes32, _Unspec] = _Unspec(), infused_challenge_chain_sub_slot_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), @@ -2331,9 +2330,9 @@ class SubSlotProofs: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_chain_slot_proof: Union[ VDFProof, _Unspec] = _Unspec(), infused_challenge_chain_slot_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), reward_chain_slot_proof: Union[ VDFProof, _Unspec] = _Unspec()) -> SubSlotProofs: ... @@ -2366,9 +2365,9 @@ class SpendBundle: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_spends: Union[ list[CoinSpend], _Unspec] = _Unspec(), aggregated_signature: Union[ G2Element, _Unspec] = _Unspec()) -> SpendBundle: ... @@ -2401,9 +2400,9 @@ class SubEpochSummary: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, prev_subepoch_summary_hash: Union[ bytes32, _Unspec] = _Unspec(), reward_chain_hash: Union[ bytes32, _Unspec] = _Unspec(), num_blocks_overflow: Union[ uint8, _Unspec] = _Unspec(), @@ -2451,9 +2450,9 @@ class UnfinishedBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlockUnfinished, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -2500,9 +2499,9 @@ class UnfinishedHeaderBlock: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlockUnfinished, _Unspec] = _Unspec(), challenge_chain_sp_proof: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -2536,9 +2535,9 @@ class VDFInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge: Union[ bytes32, _Unspec] = _Unspec(), number_of_iterations: Union[ uint64, _Unspec] = _Unspec(), output: Union[ ClassgroupElement, _Unspec] = _Unspec()) -> VDFInfo: ... @@ -2568,9 +2567,9 @@ class VDFProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, witness_type: Union[ uint8, _Unspec] = _Unspec(), witness: Union[ bytes, _Unspec] = _Unspec(), normalized_to_identity: Union[ bool, _Unspec] = _Unspec()) -> VDFProof: ... @@ -2598,9 +2597,9 @@ class RequestPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec()) -> RequestPuzzleSolution: ... @@ -2631,9 +2630,9 @@ class PuzzleSolutionResponse: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), puzzle: Union[ Program, _Unspec] = _Unspec(), @@ -2660,9 +2659,9 @@ class RespondPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, response: Union[ PuzzleSolutionResponse, _Unspec] = _Unspec()) -> RespondPuzzleSolution: ... @final @@ -2688,9 +2687,9 @@ class RejectPuzzleSolution: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec()) -> RejectPuzzleSolution: ... @@ -2715,9 +2714,9 @@ class SendTransaction: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, transaction: Union[ SpendBundle, _Unspec] = _Unspec()) -> SendTransaction: ... @final @@ -2745,9 +2744,9 @@ class TransactionAck: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, txid: Union[ bytes32, _Unspec] = _Unspec(), status: Union[ uint8, _Unspec] = _Unspec(), error: Union[ Optional[str], _Unspec] = _Unspec()) -> TransactionAck: ... @@ -2779,9 +2778,9 @@ class NewPeakWallet: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_hash: Union[ bytes32, _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), weight: Union[ uint128, _Unspec] = _Unspec(), @@ -2808,9 +2807,9 @@ class RequestBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RequestBlockHeader: ... @final @@ -2834,9 +2833,9 @@ class RespondBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, header_block: Union[ HeaderBlock, _Unspec] = _Unspec()) -> RespondBlockHeader: ... @final @@ -2860,9 +2859,9 @@ class RejectHeaderRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec()) -> RejectHeaderRequest: ... @final @@ -2890,9 +2889,9 @@ class RequestRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), coin_names: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovals: ... @@ -2924,9 +2923,9 @@ class RespondRemovals: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), coins: Union[ list[tuple[bytes32, Optional[Coin]]], _Unspec] = _Unspec(), @@ -2955,9 +2954,9 @@ class RejectRemovalsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RejectRemovalsRequest: ... @@ -2986,9 +2985,9 @@ class RequestAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ Optional[bytes32], _Unspec] = _Unspec(), puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestAdditions: ... @@ -3020,9 +3019,9 @@ class RespondAdditions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), coins: Union[ list[tuple[bytes32, list[Coin]]], _Unspec] = _Unspec(), @@ -3051,9 +3050,9 @@ class RejectAdditionsRequest: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec()) -> RejectAdditionsRequest: ... @@ -3082,9 +3081,9 @@ class RespondBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), header_blocks: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RespondBlockHeaders: ... @@ -3112,9 +3111,9 @@ class RejectBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RejectBlockHeaders: ... @@ -3143,9 +3142,9 @@ class RequestBlockHeaders: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), return_filter: Union[ bool, _Unspec] = _Unspec()) -> RequestBlockHeaders: ... @@ -3173,9 +3172,9 @@ class RequestHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RequestHeaderBlocks: ... @@ -3202,9 +3201,9 @@ class RejectHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RejectHeaderBlocks: ... @@ -3233,9 +3232,9 @@ class RespondHeaderBlocks: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec(), header_blocks: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RespondHeaderBlocks: ... @@ -3263,9 +3262,9 @@ class RegisterForPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec()) -> RegisterForPhUpdates: ... @@ -3294,9 +3293,9 @@ class RespondToPhUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec(), coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondToPhUpdates: ... @@ -3324,9 +3323,9 @@ class RegisterForCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec()) -> RegisterForCoinUpdates: ... @@ -3355,9 +3354,9 @@ class RespondToCoinUpdates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), min_height: Union[ uint32, _Unspec] = _Unspec(), coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondToCoinUpdates: ... @@ -3389,9 +3388,9 @@ class CoinStateUpdate: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, height: Union[ uint32, _Unspec] = _Unspec(), fork_height: Union[ uint32, _Unspec] = _Unspec(), peak_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3418,9 +3417,9 @@ class RequestChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_name: Union[ bytes32, _Unspec] = _Unspec()) -> RequestChildren: ... @final @@ -3444,9 +3443,9 @@ class RespondChildren: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondChildren: ... @final @@ -3472,9 +3471,9 @@ class RequestSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, start_height: Union[ uint32, _Unspec] = _Unspec(), end_height: Union[ uint32, _Unspec] = _Unspec()) -> RequestSesInfo: ... @@ -3501,9 +3500,9 @@ class RespondSesInfo: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reward_chain_hash: Union[ list[bytes32], _Unspec] = _Unspec(), heights: Union[ list[list[uint32]], _Unspec] = _Unspec()) -> RespondSesInfo: ... @@ -3528,9 +3527,9 @@ class RequestFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, time_targets: Union[ list[uint64], _Unspec] = _Unspec()) -> RequestFeeEstimates: ... @final @@ -3554,9 +3553,9 @@ class RespondFeeEstimates: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, estimates: Union[ FeeEstimateGroup, _Unspec] = _Unspec()) -> RespondFeeEstimates: ... @final @@ -3580,9 +3579,9 @@ class RequestRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemovePuzzleSubscriptions: ... @final @@ -3606,9 +3605,9 @@ class RespondRemovePuzzleSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemovePuzzleSubscriptions: ... @final @@ -3632,9 +3631,9 @@ class RequestRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ Optional[list[bytes32]], _Unspec] = _Unspec()) -> RequestRemoveCoinSubscriptions: ... @final @@ -3658,9 +3657,9 @@ class RespondRemoveCoinSubscriptions: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec()) -> RespondRemoveCoinSubscriptions: ... @final @@ -3690,9 +3689,9 @@ class CoinStateFilters: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, include_spent: Union[ bool, _Unspec] = _Unspec(), include_unspent: Union[ bool, _Unspec] = _Unspec(), include_hinted: Union[ bool, _Unspec] = _Unspec(), @@ -3727,9 +3726,9 @@ class RequestPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), previous_height: Union[ Optional[uint32], _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3765,9 +3764,9 @@ class RespondPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, puzzle_hashes: Union[ list[bytes32], _Unspec] = _Unspec(), height: Union[ uint32, _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3795,9 +3794,9 @@ class RejectPuzzleState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectPuzzleState: ... @final @@ -3827,9 +3826,9 @@ class RequestCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), previous_height: Union[ Optional[uint32], _Unspec] = _Unspec(), header_hash: Union[ bytes32, _Unspec] = _Unspec(), @@ -3858,9 +3857,9 @@ class RespondCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, coin_ids: Union[ list[bytes32], _Unspec] = _Unspec(), coin_states: Union[ list[CoinState], _Unspec] = _Unspec()) -> RespondCoinState: ... @@ -3885,9 +3884,9 @@ class RejectCoinState: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reason: Union[ int, _Unspec] = _Unspec()) -> RejectCoinState: ... @final @@ -3917,9 +3916,9 @@ class SubEpochData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, reward_chain_hash: Union[ bytes32, _Unspec] = _Unspec(), num_blocks_overflow: Union[ uint8, _Unspec] = _Unspec(), new_sub_slot_iters: Union[ Optional[uint64], _Unspec] = _Unspec(), @@ -3972,9 +3971,9 @@ class SubSlotData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, proof_of_space: Union[ Optional[ProofOfSpace], _Unspec] = _Unspec(), cc_signage_point: Union[ Optional[VDFProof], _Unspec] = _Unspec(), cc_infusion_point: Union[ Optional[VDFProof], _Unspec] = _Unspec(), @@ -4014,9 +4013,9 @@ class SubEpochChallengeSegment: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, sub_epoch_n: Union[ uint32, _Unspec] = _Unspec(), sub_slots: Union[ list[SubSlotData], _Unspec] = _Unspec(), rc_slot_end_info: Union[ Optional[VDFInfo], _Unspec] = _Unspec()) -> SubEpochChallengeSegment: ... @@ -4042,9 +4041,9 @@ class SubEpochSegments: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, challenge_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec()) -> SubEpochSegments: ... @final @@ -4068,9 +4067,9 @@ class RecentChainData: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> RecentChainData: ... @final @@ -4096,9 +4095,9 @@ class ProofBlockHeader: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, finished_sub_slots: Union[ list[EndOfSubSlotBundle], _Unspec] = _Unspec(), reward_chain_block: Union[ RewardChainBlock, _Unspec] = _Unspec()) -> ProofBlockHeader: ... @@ -4127,9 +4126,9 @@ class WeightProof: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, sub_epochs: Union[ list[SubEpochData], _Unspec] = _Unspec(), sub_epoch_segments: Union[ list[SubEpochChallengeSegment], _Unspec] = _Unspec(), recent_chain_data: Union[ list[HeaderBlock], _Unspec] = _Unspec()) -> WeightProof: ... @@ -4245,9 +4244,9 @@ class ConsensusConstants: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> Json: ... + def to_json_dict(self) -> dict[str, Any]: ... @classmethod - def from_json_dict(cls, json_dict: Any) -> Self: ... + def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... def replace(self, *, SLOT_BLOCKS_TARGET: Union[ uint32, _Unspec] = _Unspec(), MIN_BLOCKS_PER_CHALLENGE_BLOCK: Union[ uint8, _Unspec] = _Unspec(), MAX_SUB_SLOT_BLOCKS: Union[ uint32, _Unspec] = _Unspec(), diff --git a/wheel/stubtest.allowlist b/wheel/stubtest.allowlist index 77420a8f4..0da900bc1 100644 --- a/wheel/stubtest.allowlist +++ b/wheel/stubtest.allowlist @@ -7,10 +7,6 @@ chia_rs\.chia_rs\..* # runtime accessible. is there a better option for handling this? chia_rs\.ReadableBuffer -# this is offered to help with hinting only and is not intended to be -# runtime accessible. is there a better option for handling this? -chia_rs\.Json - # TODO: perhaps these should be private as _* chia_rs\.BlockRecord\.ip_iters_impl chia_rs\.BlockRecord\.ip_sub_slot_total_iters_impl From ef4c1ddf54074c4db6ffc84b99cce9d484157f93 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:24:17 -0400 Subject: [PATCH 3/7] a touch better --- wheel/generate_type_stubs.py | 10 +++++++--- wheel/python/chia_rs/chia_rs.pyi | 16 ++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 33262a7e5..6db2ee509 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,7 +22,7 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None + file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: str = "dict[str, Any]", ): def add_indent(x: str): return "\n " + x @@ -67,9 +67,9 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> {martialed_for_json_hint}: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: {martialed_for_json_hint}) -> Self: ... """ ) @@ -407,6 +407,7 @@ def __init__( "def __iadd__(self, other: G1Element) -> G1Element: ...", "def derive_unhardened(self, idx: int) -> G1Element: ...", ], + martialed_for_json_hint="str", ) print_class( file, @@ -422,6 +423,7 @@ def __init__( "def __add__(self, other: G2Element) -> G2Element: ...", "def __iadd__(self, other: G2Element) -> G2Element: ...", ], + martialed_for_json_hint="str", ) print_class( file, @@ -433,6 +435,7 @@ def __init__( "def __mul__(self, rhs: GTElement) -> GTElement: ...", "def __imul__(self, rhs: GTElement) -> GTElement : ...", ], + martialed_for_json_hint="str", ) print_class( file, @@ -449,6 +452,7 @@ def __init__( "@staticmethod", "def from_seed(seed: bytes) -> PrivateKey: ...", ], + martialed_for_json_hint="str", ) print_class( diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 0209dd864..4ce357497 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -160,9 +160,9 @@ class G1Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class G2Element: @@ -191,9 +191,9 @@ class G2Element: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class GTElement: @@ -218,9 +218,9 @@ class GTElement: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class PrivateKey: @@ -250,9 +250,9 @@ class PrivateKey: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class SpendConditions: From 2e466f34e6359036e99370b65652a5f023a74dbf Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:34:11 -0400 Subject: [PATCH 4/7] and inching closer --- wheel/generate_type_stubs.py | 8 ++++++-- wheel/python/chia_rs/chia_rs.pyi | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 6db2ee509..d3e70eb29 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,11 +22,14 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: str = "dict[str, Any]", + file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: Optional[str] = None, ): def add_indent(x: str): return "\n " + x + if martialed_for_json_hint is None: + martialed_for_json_hint = "dict[str, Any]" + init_args = "".join([(",\n " + transform_type(x)) for x in members]) all_replace_parameters = [] @@ -500,4 +503,5 @@ def __init__( ) for item in classes: - print_class(file, item[0], item[1], extra_members.get(item[0])) + # TODO: yeah... nope, don't do it this way + print_class(file, item[0], item[1], extra_members.get(item[0]), martialed_for_json_hint=None if item[0] != "Program" else "str") diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 4ce357497..fb8ee3c06 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -2013,9 +2013,9 @@ class Program: def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> dict[str, Any]: ... + def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ... + def from_json_dict(cls, json_dict: str) -> Self: ... @final class ProofOfSpace: From ae105721b7b4b7e9849c4b5493fc6e9e4f4b147d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:38:02 -0400 Subject: [PATCH 5/7] and there --- wheel/generate_type_stubs.py | 25 +++++++++++++++---------- wheel/python/chia_rs/chia_rs.pyi | 4 ++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index d3e70eb29..5453497a7 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,13 +22,16 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: Optional[str] = None, + file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martial_for_json_hint: Optional[str] = None, unmartial_from_json_hint: Optional[str] = None, ): def add_indent(x: str): return "\n " + x - if martialed_for_json_hint is None: - martialed_for_json_hint = "dict[str, Any]" + if martial_for_json_hint is None: + martial_for_json_hint = "dict[str, Any]" + + if unmartial_from_json_hint is None: + unmartial_from_json_hint = martial_for_json_hint init_args = "".join([(",\n " + transform_type(x)) for x in members]) @@ -70,9 +73,9 @@ def to_bytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def stream_to_bytes(self) -> bytes: ... def get_hash(self) -> bytes32: ... - def to_json_dict(self) -> {martialed_for_json_hint}: ... + def to_json_dict(self) -> {martial_for_json_hint}: ... @classmethod - def from_json_dict(cls, json_dict: {martialed_for_json_hint}) -> Self: ... + def from_json_dict(cls, json_dict: {unmartial_from_json_hint}) -> Self: ... """ ) @@ -410,7 +413,8 @@ def __init__( "def __iadd__(self, other: G1Element) -> G1Element: ...", "def derive_unhardened(self, idx: int) -> G1Element: ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", + unmartial_from_json_hint="Union[str, bytes]", ) print_class( file, @@ -426,7 +430,8 @@ def __init__( "def __add__(self, other: G2Element) -> G2Element: ...", "def __iadd__(self, other: G2Element) -> G2Element: ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", + unmartial_from_json_hint="Union[str, bytes]", ) print_class( file, @@ -438,7 +443,7 @@ def __init__( "def __mul__(self, rhs: GTElement) -> GTElement: ...", "def __imul__(self, rhs: GTElement) -> GTElement : ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", ) print_class( file, @@ -455,7 +460,7 @@ def __init__( "@staticmethod", "def from_seed(seed: bytes) -> PrivateKey: ...", ], - martialed_for_json_hint="str", + martial_for_json_hint="str", ) print_class( @@ -504,4 +509,4 @@ def __init__( for item in classes: # TODO: yeah... nope, don't do it this way - print_class(file, item[0], item[1], extra_members.get(item[0]), martialed_for_json_hint=None if item[0] != "Program" else "str") + print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=None if item[0] != "Program" else "str") diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index fb8ee3c06..7f8dc7c25 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -162,7 +162,7 @@ class G1Element: def get_hash(self) -> bytes32: ... def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: str) -> Self: ... + def from_json_dict(cls, json_dict: Union[str, bytes]) -> Self: ... @final class G2Element: @@ -193,7 +193,7 @@ class G2Element: def get_hash(self) -> bytes32: ... def to_json_dict(self) -> str: ... @classmethod - def from_json_dict(cls, json_dict: str) -> Self: ... + def from_json_dict(cls, json_dict: Union[str, bytes]) -> Self: ... @final class GTElement: From b0ef5df67496b16e9fc4b49b0b2e2d412a15c336 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 10:54:37 -0400 Subject: [PATCH 6/7] tidy code hack --- wheel/generate_type_stubs.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 5453497a7..1ff2e9562 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -22,7 +22,12 @@ def transform_type(m: str) -> str: def print_class( - file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martial_for_json_hint: Optional[str] = None, unmartial_from_json_hint: Optional[str] = None, + file: TextIO, + name: str, + members: list[str], + extra: Optional[list[str]] = None, + martial_for_json_hint: Optional[str] = None, + unmartial_from_json_hint: Optional[str] = None, ): def add_indent(x: str): return "\n " + x @@ -508,5 +513,9 @@ def __init__( ) for item in classes: - # TODO: yeah... nope, don't do it this way - print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=None if item[0] != "Program" else "str") + # TODO: adjust the system to provide this control via more paths + martial_for_json_hint = None + if item[0] == "Program": + martial_for_json_hint = "str" + + print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=martial_for_json_hint) From 5b85f754988a9d8ad748c24ecc5cc17c99a83457 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 25 Oct 2024 11:10:41 -0400 Subject: [PATCH 7/7] black --- wheel/generate_type_stubs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 1ff2e9562..169ab53b6 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -518,4 +518,10 @@ def __init__( if item[0] == "Program": martial_for_json_hint = "str" - print_class(file, item[0], item[1], extra_members.get(item[0]), martial_for_json_hint=martial_for_json_hint) + print_class( + file, + item[0], + item[1], + extra_members.get(item[0]), + martial_for_json_hint=martial_for_json_hint, + )