Mempool Mini-Protocol

class ogmios.mempool.AcquireMempool(client: Client)

Bases: object

Ogmios method to acquire a mempool snapshot.

NOTE: This class is not intended to be used directly. Instead, use the Client.acquire_mempool method.

Parameters:

client (Client) – The client to use for the request.

execute(id: Any | None = None)

Send and receive the request.

Parameters:

id (Any) – The ID of the request.

Returns:

The slot number of the acquired mempool snapshot and ID of the response.

Return type:

(int, Optional[Any])

receive()

Receive a previously requested response.

Returns:

The slot number of the acquired mempool snapshot and ID of the response.

Return type:

(int, Optional[Any])

send(id: Any | None = None) None

Send the request.

Parameters:

id (Any) – The ID of the request.

class ogmios.mempool.HasTransaction(client: Client)

Bases: object

Ogmios method to ask whether a given transaction is present in the acquired mempool snapshot.

NOTE: This class is not intended to be used directly. Instead, use the Client.has_transaction method.

Parameters:

client (Client) – The client to use for the request.

execute(tx_id: str, id: Any | None = None)

Send and receive the request.

Parameters:
  • tx_id (str) – The ID of the transaction to check for.

  • id (Any) – The ID of the request.

Returns:

Whether the transaction is present in the mempool snapshot and ID of the response.

Return type:

(bool, Optional[Any])

receive()

Receive a previously requested response.

Returns:

Whether the transaction is present in the mempool snapshot and ID of the response.

Return type:

(bool, Optional[Any])

send(tx_id: str, id: Any | None = None) None

Send the request.

Parameters:
  • tx_id (str) – The ID of the transaction to check for.

  • id (Any) – The ID of the request.

class ogmios.mempool.NextTransaction(client: Client)

Bases: object

Ogmios method to request the next mempool transaction from an acquired snapshot.

NOTE: This class is not intended to be used directly. Instead, use the Client.next_transaction method.

Parameters:

client (Client) – The client to use for the request.

execute(id: Any | None = None)

Send and receive the request.

Parameters:
  • full_tx (bool) – If true, the full transaction will be returned. Otherwise, only the transaction ID will be returned.

  • id (Any) – The ID of the request.

Returns:

The next mempool transaction from an acquired snapshot and ID of the response.

Return type:

(dict, Optional[Any])

receive()

Receive a previously requested response.

Returns:

The next mempool transaction from an acquired snapshot and ID of the response.

Return type:

(dict, Optional[Any])

send(id: Any | None = None) None

Send the request.

Parameters:

id (Any) – The ID of the request.

class ogmios.mempool.ReleaseMempool(client: Client)

Bases: object

Ogmios method to release a mempool snapshot.

NOTE: This class is not intended to be used directly. Instead, use the Client.release_mempool method.

Parameters:

client (Client) – The client to use for the request.

execute(id: Any | None = None) Any | None

Send and receive the request.

Parameters:

id (Any) – The ID of the request.

Returns:

The ID of the response.

Return type:

Optional[Any]

receive()

Receive a previously requested response.

Returns:

The ID of the response.

Return type:

Optional[Any]

send(id: Any | None = None) None

Send the request.

Parameters:

id (Any) – The ID of the request.

class ogmios.mempool.SizeOfMempool(client: Client)

Bases: object

Ogmios method to get the size and capacities of the mempool snapshot.

NOTE: This class is not intended to be used directly. Instead, use the Client.size_of_mempool method.

Parameters:

client (Client) – The client to use for the request.

execute(id: Any | None = None)

Send and receive the request.

Parameters:

id (Any) – The ID of the request.

Returns:

The max capacity (bytes), current size (bytes), and number of transactions of the acquired mempool snapshot and ID of the response.

Return type:

(int, int, int, Optional[Any])

receive()

Receive a previously requested response.

Returns:

The max capacity (bytes), current size (bytes), and number of transactions of the acquired mempool snapshot and ID of the response.

Return type:

(int, int, int, Optional[Any])

send(id: Any | None = None) None

Send the request.

Parameters:

id (Any) – The ID of the request.