Skip to content

Commit a233e58

Browse files
pyi: add missing methods
1 parent 7c2a525 commit a233e58

9 files changed

Lines changed: 100 additions & 0 deletions

‎src/python/monero_block.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ class MoneroBlock(MoneroBlockHeader):
1515
txs: list[MoneroTx]
1616
"""List of non-coinbase transactions in the block."""
1717

18+
@staticmethod
19+
def deserialize(json: str) -> MoneroBlock:
20+
"""
21+
Deserialize a MoneroBlock from a JSON string.
22+
23+
:param str json: MoneroBlock in JSON format.
24+
:returns MoneroBlock: deserialized instance.
25+
"""
26+
...
27+
1828
def __init__(self) -> None:
1929
"""Initialize a Monero block."""
2030
...

‎src/python/monero_block_header.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ class MoneroBlockHeader(SerializableStruct):
5050
weight: int | None
5151
"""The adjusted block size, in bytes. This is the raw size, plus a positive adjustment for any Bulletproof transactions with more than 2 outputs."""
5252

53+
@staticmethod
54+
def deserialize(json: str) -> MoneroBlockHeader:
55+
"""
56+
Deserialize a MoneroBlockHeader from a JSON string.
57+
58+
:param str json: MoneroBlockHeader in JSON format.
59+
:returns MoneroBlockHeader: deserialized instance.
60+
"""
61+
...
62+
5363
def __init__(self) -> None:
5464
"""Initialize a Monero block header."""
5565
...

‎src/python/monero_check.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ class MoneroCheck(SerializableStruct):
77
is_good: bool
88
"""Indicates if check was successfull."""
99

10+
@staticmethod
11+
def deserialize(json: str) -> MoneroCheck:
12+
"""
13+
Deserialize a MoneroCheck from a JSON string.
14+
15+
:param str json: MoneroCheck in JSON format.
16+
:returns MoneroCheck: deserialized instance.
17+
"""
18+
...
19+
1020
def __init__(self) -> None:
1121
"""Initialize a Monero check."""
1222
...

‎src/python/monero_decoded_address.pyi‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
from __future__ import annotations
2+
3+
import typing
4+
15
from .serializable_struct import SerializableStruct
26
from .monero_address_type import MoneroAddressType
37
from .monero_network_type import MoneroNetworkType
@@ -13,6 +17,22 @@ class MoneroDecodedAddress(SerializableStruct):
1317
network_type: MoneroNetworkType
1418
"""Network type of the decoded address."""
1519

20+
@staticmethod
21+
def deserialize(json: str) -> MoneroDecodedAddress:
22+
"""
23+
Deserialize a MoneroDecodedAddress from a JSON string.
24+
25+
:param str json: MoneroDecodedAddress in JSON format.
26+
:returns MoneroDecodedAddress: deserialized instance.
27+
"""
28+
...
29+
30+
@typing.overload
31+
def __init__(self) -> None:
32+
"""Initialize an empty Monero decoded address."""
33+
...
34+
35+
@typing.overload
1636
def __init__(self, address: str, address_type: MoneroAddressType, network_type: MoneroNetworkType) -> None:
1737
"""
1838
Initialize a Monero decoded address.

‎src/python/monero_incoming_transfer.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class MoneroIncomingTransfer(MoneroTransfer):
1313
subaddress_index: int | None
1414
"""The subaddress index that received funds within this transfer."""
1515

16+
@staticmethod
17+
def deserialize(json: str) -> MoneroIncomingTransfer:
18+
"""
19+
Deserialize a MoneroIncomingTransfer from a JSON string.
20+
21+
:param str json: MoneroIncomingTransfer in JSON format.
22+
:returns MoneroIncomingTransfer: deserialized instance.
23+
"""
24+
...
25+
1626
def __init__(self) -> None:
1727
"""Initialize a Monero incoming transfer."""
1828
...

‎src/python/monero_key_image_export_result.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ class MoneroKeyImageExportResult(SerializableStruct):
1717
key_images: list[MoneroKeyImage]
1818
"""The exported key images, one per owned output starting at `offset`."""
1919

20+
@staticmethod
21+
def deserialize(json: str) -> MoneroKeyImageExportResult:
22+
"""
23+
Deserialize a MoneroKeyImageExportResult from a JSON string.
24+
25+
:param str json: MoneroKeyImageExportResult in JSON format.
26+
:returns MoneroKeyImageExportResult: deserialized instance.
27+
"""
28+
...
29+
2030
def __init__(self) -> None:
2131
"""Initialize a Monero key image export result."""
2232
...

‎src/python/monero_outgoing_transfer.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ class MoneroOutgoingTransfer(MoneroTransfer):
1414
subaddress_indices: list[int]
1515
"""Subaddresses from which the transfer originated."""
1616

17+
@staticmethod
18+
def deserialize(json: str) -> MoneroOutgoingTransfer:
19+
"""
20+
Deserialize a MoneroOutgoingTransfer from a JSON string.
21+
22+
:param str json: MoneroOutgoingTransfer in JSON format.
23+
:returns MoneroOutgoingTransfer: deserialized instance.
24+
"""
25+
...
26+
1727
def __init__(self) -> None:
1828
...
1929

‎src/python/monero_sync_result.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ class MoneroSyncResult(SerializableStruct):
1111
received_money: bool
1212
"""Indicates if money was received."""
1313

14+
@staticmethod
15+
def deserialize(json: str) -> MoneroSyncResult:
16+
"""
17+
Deserialize a MoneroSyncResult from a JSON string.
18+
19+
:param str json: MoneroSyncResult in JSON format.
20+
:returns MoneroSyncResult: deserialized instance.
21+
"""
22+
...
23+
1424
@typing.overload
1525
def __init__(self) -> None:
1626
"""Initialize a Monero sync result."""

‎src/python/ssl_options.pyi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ class SslOptions(SerializableStruct):
1515
ssl_allow_any_cert: bool | None
1616
"""Allow any certificate."""
1717

18+
@staticmethod
19+
def deserialize(json: str) -> SslOptions:
20+
"""
21+
Deserialize an SslOptions from a JSON string.
22+
23+
:param str json: SslOptions in JSON format.
24+
:returns SslOptions: deserialized instance.
25+
"""
26+
...
27+
1828
def __init__(self) -> None:
1929
"""Initialize a new rpc connection ssl options."""
2030
...

0 commit comments

Comments
 (0)