API Reference

CLI Utilities

Exchange Commands

synopsis:Commands module to issue orders or quotes to the exchange.
author:Amr Ali <amr@ledgerx.com>

Get a specific commands module that corresponds to a particular protocol version.

Parameters:version – A version string in the format major.minor.build.
Returns:None or a commands module corresponding to the version supplied.

Library Context

Mixin Helpers

synopsis:A module containing useful utilities.
author:Amr Ali <amr@ledgerx.com>

A decorator to avoid retyping function/class names in __all__.

Message Processing

Setting Variables and Configurations

synopsis:A module that lets clients specify settings.

Memory Store Facilities

synopsis:Memory stores facilities.
author:Amr Ali <amr@ledgerx.com>
class ledgerx.sdk.store.MemoryStore(shared=False)[source]

An inter-process in-memory store to provide common facilities for loading data from different sources. Namely from another process. This container can be constructed to not be shared among forked processes.

class ledgerx.sdk.store.IDStoreItem(msg=None, cb=<function IDStoreItem.<lambda>>)[source]

A class to represent a MessageIDStore’s item.

  • msg – A property that holds a message object.
  • callback – A callable that accepts two arguments, the first is the just received message object and the second is the previous message with the same message ID.
class ledgerx.sdk.store.MessageIDStore[source]

A store to keep track of the IDs of in-progress messages.

Miscellaneous Utilities

synopsis:Miscellaneous tools.
author:Amr Ali <amr@ledgerx.com>

Metaclass Patterns

synopsis:Module for metaclass patterns.
author:Amr Ali <amr@ledgerx.com>
class ledgerx.sdk.utils.meta.KindSingletonMeta(name, bases, attrs)[source]

A singleton pattern metaclass that uses the underlying class’ name as the unique constraint.

class ledgerx.sdk.utils.meta.SingletonAbstractMeta(name, bases, attrs)[source]

A Singleton pattern abstract metaclass.

ledgerx.sdk.utils.import_versions(basefile, package)[source]

Iterate over version files and import all version modules.

Returns:A dictionary of versions x.x.x and imported version modules.
ledgerx.sdk.utils.reraise(ex, message=None)[source]

Reraise the exception last happened with the original traceback.

  • ex (A subclass of Exception.) – The exception to be raised instead of the original one.
  • message (str) – An optional message to replace the old exception’s message.


Version Utilities

synopsis:A module that contain version details for the package.
author:Amr Ali <amr@ledgerx.com>

Update version information here only. There’s no need to update any other file in the package.

Release of a hotfix/bugfix: - Increment version’s BUILD field.

Release of an update that modifies the API but maintains backward compatibility: - Increment version’s MINOR field and reset the BUILD field.

Release of an update that that modifies the API and breaks backward compatibility: - Increment version’s MAJOR field and reset both the MINOR and BUILD fields.