Skip to content

Binary RPC

The conversions for the binary interface of the daemon, which send_binary_request speaks: the parameters of a request from a dictionary or JSON to the binary format of monero, and its response back.

dict_to_binary(dictionary) staticmethod

Converts a dictionary into binary format.

Parameters:

Name Type Description Default
dictionary dict

The dictionary to convert in binary format.

required

Returns:

Type Description
bytes

Binary format.

binary_to_dict(bin) staticmethod

Deserialize a dictionary from binary format.

Parameters:

Name Type Description Default
bin bytes

Dictionary in binary format.

required

Returns:

Type Description
dict[Any, Any]

Deserialized dictionary.

json_to_binary(json) staticmethod

Convert a JSON string into binary format.

Parameters:

Name Type Description Default
json str

JSON string to convert.

required

Returns:

Type Description
bytes

Binary format.

binary_to_json(bin) staticmethod

Deserialize a JSON string from binary format.

Parameters:

Name Type Description Default
bin bytes

JSON string in binary format.

required

Returns:

Type Description
str

The deserialized JSON string.

binary_blocks_to_json(bin) staticmethod

Deserialize blocks JSON string from binary format.

Parameters:

Name Type Description Default
bin bytes

blocks JSON string in binary format.

required

Returns:

Type Description
str

The deserialized blocks in JSON string format.

binary_blocks_fast_to_json(bin) staticmethod

Deserialize blocks JSON string from the daemon's fast (get_blocks.bin) binary format.

Parameters:

Name Type Description Default
bin bytes

blocks JSON string in the fast binary format.

required

Returns:

Type Description
str

The deserialized blocks in JSON string format.