cfxdb.xbrmm.channel

Attributes

Classes

Channel

XBR off-chain payment or paying channel.

ChannelBalance

XBR payment channel current (off-chain) balance. The sum of Balance.remaining and Balance.inflight equals Channel.amount.

IndexPayingChannelByDelegate

Index: (delegate_adr, created_timestamp) -> channel_oid

IndexPayingChannelByRecipient

Index: (recipient_adr, created_timestamp) -> channel_oid

IndexPaymentChannelByActor

Index: (actor_adr, created_timestamp) -> channel_oid

IndexPaymentChannelByDelegate

Index: (delegate_adr, created_timestamp) -> channel_oid

PayingChannelBalances

XBR paying channels current balances by channel_oid.

PayingChannels

XBR paying channels by channel_oid.

PaymentChannelBalances

XBR payment channels current balances by channel_oid.

PaymentChannels

XBR payment channels by channel_oid.

_ChannelBalanceGen

Expand methods on the class code generated by flatc.

_ChannelGen

Expand methods on the class code generated by flatc.

Module Contents

class Channel(from_fbs=None)[source]

Bases: object

XBR off-chain payment or paying channel.

__str__()[source]
_actor = None[source]
_amount = None[source]
_channel_oid = None[source]
_channel_type = None[source]
_close_balance = None[source]
_close_channel_seq = None[source]
_close_del_sig = None[source]
_close_is_final = None[source]
_close_mm_sig = None[source]
_closed_at = None[source]
_closed_tx = None[source]
_closing_at = None[source]
_delegate = None[source]
_from_fbs = None[source]
_market_oid = None[source]
_marketmaker = None[source]
_member_oid = None[source]
_open_at = None[source]
_recipient = None[source]
_seq = None[source]
_state = None[source]
_timeout = None[source]
_timestamp = None[source]
property actor: bytes[source]

Ethereum address of the sender (either XBR Consumer or XBR Market).

property amount: int[source]

Amount of XBR tokens initially deposited into the payment channel.

build(builder)[source]
static cast(buf)[source]
property channel_oid: uuid.UUID[source]

The unique OID of the channel.

property channel_type: int[source]

payment channel (from XBR consumer to XBR market maker) or paying channel (from XBR market maker to XBR provider).

Type:

Channel type

property close_balance: int[source]

Remaining (closing) channel balance (XBR).

property close_channel_seq: int[source]

channel transaction sequence number.

Type:

Last off-chain, closing transaction

property close_del_sig: bytes[source]

Closing signature by (seller or buyer) delegate.

property close_is_final: bool[source]

Flag indication if close is final (happens immediately without a channel timeout).

property close_mm_sig: int[source]

Closing signature by market maker.

property closed_at: int[source]

Block number (on the blockchain) when the payment channel was finally closed.

property closed_tx: bytes[source]

When channel was finally closed on-chain, the Ethereum transaction ID.

property closing_at: int[source]

Block number (on the blockchain) when the payment channel will close (at the latest).

property delegate: bytes[source]

Ethereum address of the sender delegate (either XBR Consumer delegate or XBR Market delegate == market maker)

property market_oid: uuid.UUID[source]

The unique OID of the market.

property marketmaker: bytes[source]

ID of the payment channel.

marshal() dict[source]
property member_oid: uuid.UUID[source]

The unique OID of the member.

property open_at: int[source]

Block number (on the blockchain) when the actor (originally) joined the market.

property recipient: bytes[source]

Ethereum address of the recipient (either XBR Market or XBR Provider)

property seq: int[source]

Global channel sequence number.

property state: int[source]

Current state of payment channel.

property timeout: int[source]

Payment channel (non-cooperative) closed timeout in blocks (on the blockchain).

property timestamp: numpy.datetime64[source]

Database transaction time (epoch time in ns) of insert or last update.

class ChannelBalance(from_fbs=None)[source]

Bases: object

XBR payment channel current (off-chain) balance. The sum of Balance.remaining and Balance.inflight equals Channel.amount.

__str__()[source]
_from_fbs = None[source]
_inflight = None[source]
_remaining = None[source]
_seq = None[source]
build(builder)[source]
static cast(buf)[source]
property inflight: int[source]

Amount of XBR tokens reserved to in-flight purchase transactions.

marshal() dict[source]
static parse(data: dict)[source]
property remaining: int[source]

Amount of XBR tokens currently remaining in the payment channel.

property seq: int[source]

Sequence number of transactions on this balance starting from 0 when the payment channel is created.

ChannelState[source]
ChannelType[source]
class IndexPayingChannelByDelegate(slot=None, compress=None)[source]

Bases: zlmdb.MapBytes20TimestampUuid

Index: (delegate_adr, created_timestamp) -> channel_oid

class IndexPayingChannelByRecipient(slot=None, compress=None)[source]

Bases: zlmdb.MapBytes20TimestampUuid

Index: (recipient_adr, created_timestamp) -> channel_oid

class IndexPaymentChannelByActor(slot=None, compress=None)[source]

Bases: zlmdb.MapBytes20TimestampUuid

Index: (actor_adr, created_timestamp) -> channel_oid

class IndexPaymentChannelByDelegate(slot=None, compress=None)[source]

Bases: zlmdb.MapBytes20TimestampUuid

Index: (delegate_adr, created_timestamp) -> channel_oid

class PayingChannelBalances(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapUuidFlatBuffers

XBR paying channels current balances by channel_oid.

Map zlmdb.MapBytes20FlatBuffers from channel_oid to cfxdb.xbr.Balance

class PayingChannels(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapUuidFlatBuffers

XBR paying channels by channel_oid.

Map zlmdb.MapUuidFlatBuffers from channel_oid to cfxdb.xbr.Channel

class PaymentChannelBalances(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapUuidFlatBuffers

XBR payment channels current balances by channel_oid.

Map zlmdb.MapBytes20FlatBuffers from channel_oid to cfxdb.xbr.Balance

class PaymentChannels(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapUuidFlatBuffers

XBR payment channels by channel_oid.

Map zlmdb.MapUuidFlatBuffers from channel_oid to cfxdb.xbr.Channel

class _ChannelBalanceGen[source]

Bases: cfxdb.gen.xbrmm.ChannelBalance.ChannelBalance

Expand methods on the class code generated by flatc.

FIXME: come up with a PR for flatc to generated this stuff automatically.

classmethod GetRootAsChannelBalance(buf, offset)[source]

This method is deprecated. Please switch to GetRootAs.

InflightAsBytes()[source]
RemainingAsBytes()[source]
class _ChannelGen[source]

Bases: cfxdb.gen.xbrmm.Channel.Channel

Expand methods on the class code generated by flatc.

FIXME: come up with a PR for flatc to generated this stuff automatically.

ActorAsBytes()[source]
AmountAsBytes()[source]
ChannelOidAsBytes()[source]
CloseBalanceAsBytes()[source]
CloseDelSigAsBytes()[source]
CloseMmSigAsBytes()[source]
ClosedAtAsBytes()[source]
ClosedTxAsBytes()[source]
ClosingAtAsBytes()[source]
DelegateAsBytes()[source]
classmethod GetRootAsChannel(buf, offset)[source]

This method is deprecated. Please switch to GetRootAs.

MarketOidAsBytes()[source]
MarketmakerAsBytes()[source]
MemberOidAsBytes()[source]
OpenAtAsBytes()[source]
RecipientAsBytes()[source]