ag.orbit package

Op_Return Bitcoin-Implemented Tokens

ORBIT is a specification and API for tokens on Bitcoin Cash.

class ag.orbit.API[source]

Bases: object

Main API for ORBIT events.

OP_ADVERTISE = b'\xaa'
OP_ADVERTISE_CANCEL = b'\xac'
OP_CREATE = b'\xa1'
OP_REGISTER = b'\xb0'
OP_RESERVED_BEGIN = 'bð'
OP_RESERVED_END = 'bÿ'
OP_TRANSFER = b'\x10'
OP_UNREGISTER = b'\xb1'
PREAMBLE = b'\xa4 \x19\x81'
VERSION = b'\x00'
class Version(version)[source]

Bases: object

Simple version parser.

Separates a version string into major and minor components, and provides an encoded representation (major component only).

Parameters:version (str) – Version string to parse.
Raises:ValueError – If the version string is not valid.
launched = 542161
parse(data, combined=False)[source]

Parse serialized bytes retrieved from OP_RETURN data.

Parameters:data (bytes) – The serialized bytes to parse.
Returns:An operation representing the data.
Return type:Abstract
Raises:ValueError – If the byte stream does not represent a valid operation.
prepare(address, op, limit=0)[source]

Prepare a serialized byte stream to be stored as OP_RETURN data.

Parameters:
  • address (str) – Bitcoin cash address for the token.
  • op (Abstract) – The operation to serialize.
Returns:

Serialized representation of the operation.

Return type:

bytes

Raises:

ValueError – If there is a problem serializing the operation.

version = <ag.orbit.API.Version object>

Submodules

ag.orbit.command module

Helpers for command-line interfaces

ag.orbit.command.invoke(call, cmd, exit_val, run, args, args_min=0, args_max=0, pass_single=False, optional=False)[source]
ag.orbit.command.main(run)[source]
ag.orbit.command.read_char()

ag.orbit.config module

Set up some variables for access to configuration.

A system-dependent user configuration directory is automatically created.

ag.orbit.encryption module

ag.orbit.encryption.decrypt(data, password)[source]
ag.orbit.encryption.encrypt(data, password)[source]
ag.orbit.encryption.mkkey(password, salt)[source]
ag.orbit.encryption.pad(data)[source]
ag.orbit.encryption.unpad(data)[source]

ag.orbit.wallet module

ag.orbit.wallet.access(wpath, get_password=None)[source]
ag.orbit.wallet.create(wpath=None, get_key=None, get_password=None, show_address=None, unencrypted_warning=None)[source]
ag.orbit.wallet.list()[source]
ag.orbit.wallet.path(name)[source]

ag.orbit.webapi module

class ag.orbit.webapi.Client(host=None, port=None)[source]

Bases: object

get_user_tokens(address)[source]
class ag.orbit.webapi.Endpoints[source]

Bases: object

USER_TOKENS = 'usertokens'