cfxdb.xbrmm¶
Submodules¶
Classes¶
XBR off-chain payment or paying channel. |
|
XBR payment channel current (off-chain) balance. The sum of |
|
Record of downloaded files from Infura |
|
Persisted IPFS files download log |
|
Index: key_id -> offer_id |
|
Index: |
|
Index: |
|
Index: |
|
Database (index) table for (member_oid, created) -> userkey mapping. |
|
Data encryption key offerings by XBR providers. |
|
Persisted data encryption key offers. |
|
XBR off-chain payment or paying channel. |
|
XBR payment channel current (off-chain) balance. The sum of |
|
XBR paying channels current balances by |
|
XBR paying channels by |
|
XBR off-chain payment or paying channel. |
|
XBR payment channel current (off-chain) balance. The sum of |
|
XBR payment channels current balances by |
|
XBR payment channels by |
|
CFC edge database schema for ZLMDB. |
|
Data encryption key buy-sell transactions. |
|
Data encryption key (off-chain) market transactions. |
|
User client (public) keys. |
|
Database table for user client keys. |
Package Contents¶
- class Channel(from_fbs=None)[source]¶
Bases:
objectXBR off-chain payment or paying channel.
- _actor = None¶
- _amount = None¶
- _channel_oid = None¶
- _channel_type = None¶
- _close_balance = None¶
- _close_channel_seq = None¶
- _close_del_sig = None¶
- _close_is_final = None¶
- _close_mm_sig = None¶
- _closed_at = None¶
- _closed_tx = None¶
- _closing_at = None¶
- _delegate = None¶
- _from_fbs = None¶
- _market_oid = None¶
- _marketmaker = None¶
- _member_oid = None¶
- _open_at = None¶
- _recipient = None¶
- _seq = None¶
- _state = None¶
- _timeout = None¶
- _timestamp = None¶
- property channel_type: int¶
payment channel (from XBR consumer to XBR market maker) or paying channel (from XBR market maker to XBR provider).
- Type:
Channel type
- property close_channel_seq: int¶
channel transaction sequence number.
- Type:
Last off-chain, closing transaction
- property close_is_final: bool¶
Flag indication if close is final (happens immediately without a channel timeout).
- property closed_at: int¶
Block number (on the blockchain) when the payment channel was finally closed.
- property closing_at: int¶
Block number (on the blockchain) when the payment channel will close (at the latest).
- property delegate: bytes¶
Ethereum address of the sender delegate (either XBR Consumer delegate or XBR Market delegate == market maker)
- property open_at: int¶
Block number (on the blockchain) when the actor (originally) joined the market.
- property timeout: int¶
Payment channel (non-cooperative) closed timeout in blocks (on the blockchain).
- property timestamp: numpy.datetime64¶
Database transaction time (epoch time in ns) of insert or last update.
- class ChannelBalance(from_fbs=None)[source]¶
Bases:
objectXBR payment channel current (off-chain) balance. The sum of
Balance.remainingandBalance.inflightequalsChannel.amount.- _from_fbs = None¶
- _inflight = None¶
- _remaining = None¶
- _seq = None¶
- class IPFSFile(from_fbs=None)[source]¶
Record of downloaded files from Infura
- _downloaded = None¶
- _errored_at = None¶
- _file_hash = None¶
- _from_fbs = None¶
- _retries = None¶
- property errored_at: numpy.datetime64¶
Time of last time when downloaded errorred.
- class IPFSFiles(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapStringFlatBuffersPersisted IPFS files download log
Map
zlmdb.MapStringFlatBuffersfromfile_hashtocfxdb.xbrmm.IPFSFile
- class IndexOfferByKey(slot=None, compress=None)[source]¶
Bases:
zlmdb.MapUuidUuidIndex: key_id -> offer_id
- class IndexPayingChannelByDelegate(slot=None, compress=None)[source]¶
Bases:
zlmdb.MapBytes20TimestampUuidIndex:
(delegate_adr, created_timestamp) -> channel_oid
- class IndexPayingChannelByRecipient(slot=None, compress=None)[source]¶
Bases:
zlmdb.MapBytes20TimestampUuidIndex:
(recipient_adr, created_timestamp) -> channel_oid
- class IndexPaymentChannelByDelegate(slot=None, compress=None)[source]¶
Bases:
zlmdb.MapBytes20TimestampUuidIndex:
(delegate_adr, created_timestamp) -> channel_oid
- class IndexUserKeyByMember(slot=None, compress=None)[source]¶
Bases:
zlmdb.MapUuidTimestampBytes32Database (index) table for (member_oid, created) -> userkey mapping.
- class Offer(from_fbs=None)[source]¶
Bases:
objectData encryption key offerings by XBR providers.
- _api = None¶
- _categories = None¶
- _copies = None¶
- _expires = None¶
- _from_fbs = None¶
- _key = None¶
- _offer = None¶
- _price = None¶
- _remaining = None¶
- _seller = None¶
- _seller_authid = None¶
- _seller_session_id = None¶
- _signature = None¶
- _timestamp = None¶
- _uri = None¶
- _valid_from = None¶
- property api: uuid.UUID¶
ID of the API the encrypted data (this key is for) is provided under.
- Returns:
- property categories: dict¶
Dictionary of optional user defined categories the specific data that is provided falls under.
- property copies: int¶
Optional maximum number of times this data encryption key is to be sold or 0 for unlimited.
- property expires: numpy.datetime64¶
Optional data at which this offer expires (epoch time in ns).
- property remaining: int¶
Remaining number of copies to be sold (if “copies” is set >0, otherwise 0).
- property signature: bytes¶
Seller delegate signature for the offer. The signature covers all information of the original offer placement request and requestor.
- property timestamp: numpy.datetime64¶
Offer transaction time (epoch time in ns)
- property valid_from: numpy.datetime64¶
Timestamp from which the offer is valid (epoch time in ns).
- class Offers(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapUuidFlatBuffersPersisted data encryption key offers.
Map
zlmdb.MapBytes32FlatBuffersfromoffer_idtocfxdb.xbr.Offer
- class PayingChannel(from_fbs=None)¶
Bases:
objectXBR off-chain payment or paying channel.
- __str__()¶
- _actor = None¶
- _amount = None¶
- _channel_oid = None¶
- _channel_type = None¶
- _close_balance = None¶
- _close_channel_seq = None¶
- _close_del_sig = None¶
- _close_is_final = None¶
- _close_mm_sig = None¶
- _closed_at = None¶
- _closed_tx = None¶
- _closing_at = None¶
- _delegate = None¶
- _from_fbs = None¶
- _market_oid = None¶
- _marketmaker = None¶
- _member_oid = None¶
- _open_at = None¶
- _recipient = None¶
- _seq = None¶
- _state = None¶
- _timeout = None¶
- _timestamp = None¶
- build(builder)¶
- static cast(buf)¶
- property channel_type: int¶
payment channel (from XBR consumer to XBR market maker) or paying channel (from XBR market maker to XBR provider).
- Type:
Channel type
- property close_channel_seq: int¶
channel transaction sequence number.
- Type:
Last off-chain, closing transaction
- property close_is_final: bool¶
Flag indication if close is final (happens immediately without a channel timeout).
- property closed_at: int¶
Block number (on the blockchain) when the payment channel was finally closed.
- property closing_at: int¶
Block number (on the blockchain) when the payment channel will close (at the latest).
- property delegate: bytes¶
Ethereum address of the sender delegate (either XBR Consumer delegate or XBR Market delegate == market maker)
- property open_at: int¶
Block number (on the blockchain) when the actor (originally) joined the market.
- property timeout: int¶
Payment channel (non-cooperative) closed timeout in blocks (on the blockchain).
- property timestamp: numpy.datetime64¶
Database transaction time (epoch time in ns) of insert or last update.
- class PayingChannelBalance(from_fbs=None)¶
Bases:
objectXBR payment channel current (off-chain) balance. The sum of
Balance.remainingandBalance.inflightequalsChannel.amount.- __str__()¶
- _from_fbs = None¶
- _inflight = None¶
- _remaining = None¶
- _seq = None¶
- build(builder)¶
- static cast(buf)¶
- class PayingChannelBalances(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapUuidFlatBuffersXBR paying channels current balances by
channel_oid.Map
zlmdb.MapBytes20FlatBuffersfromchannel_oidtocfxdb.xbr.Balance
- class PayingChannels(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapUuidFlatBuffersXBR paying channels by
channel_oid.Map
zlmdb.MapUuidFlatBuffersfromchannel_oidtocfxdb.xbr.Channel
- class PaymentChannel(from_fbs=None)¶
Bases:
objectXBR off-chain payment or paying channel.
- __str__()¶
- _actor = None¶
- _amount = None¶
- _channel_oid = None¶
- _channel_type = None¶
- _close_balance = None¶
- _close_channel_seq = None¶
- _close_del_sig = None¶
- _close_is_final = None¶
- _close_mm_sig = None¶
- _closed_at = None¶
- _closed_tx = None¶
- _closing_at = None¶
- _delegate = None¶
- _from_fbs = None¶
- _market_oid = None¶
- _marketmaker = None¶
- _member_oid = None¶
- _open_at = None¶
- _recipient = None¶
- _seq = None¶
- _state = None¶
- _timeout = None¶
- _timestamp = None¶
- build(builder)¶
- static cast(buf)¶
- property channel_type: int¶
payment channel (from XBR consumer to XBR market maker) or paying channel (from XBR market maker to XBR provider).
- Type:
Channel type
- property close_channel_seq: int¶
channel transaction sequence number.
- Type:
Last off-chain, closing transaction
- property close_is_final: bool¶
Flag indication if close is final (happens immediately without a channel timeout).
- property closed_at: int¶
Block number (on the blockchain) when the payment channel was finally closed.
- property closing_at: int¶
Block number (on the blockchain) when the payment channel will close (at the latest).
- property delegate: bytes¶
Ethereum address of the sender delegate (either XBR Consumer delegate or XBR Market delegate == market maker)
- property open_at: int¶
Block number (on the blockchain) when the actor (originally) joined the market.
- property timeout: int¶
Payment channel (non-cooperative) closed timeout in blocks (on the blockchain).
- property timestamp: numpy.datetime64¶
Database transaction time (epoch time in ns) of insert or last update.
- class PaymentChannelBalance(from_fbs=None)¶
Bases:
objectXBR payment channel current (off-chain) balance. The sum of
Balance.remainingandBalance.inflightequalsChannel.amount.- __str__()¶
- _from_fbs = None¶
- _inflight = None¶
- _remaining = None¶
- _seq = None¶
- build(builder)¶
- static cast(buf)¶
- class PaymentChannelBalances(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapUuidFlatBuffersXBR payment channels current balances by
channel_oid.Map
zlmdb.MapBytes20FlatBuffersfromchannel_oidtocfxdb.xbr.Balance
- class PaymentChannels(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapUuidFlatBuffersXBR payment channels by
channel_oid.Map
zlmdb.MapUuidFlatBuffersfromchannel_oidtocfxdb.xbr.Channel
- class Schema(db)[source]¶
Bases:
objectCFC edge database schema for ZLMDB.
- static attach(db)[source]¶
Factory to create a schema from attaching to a database. The schema tables will be automatically mapped as persistant maps and attached to the database slots.
- Parameters:
db – zlmdb.Database
- Returns:
object of Schema
- consents: cfxdb.xbr.consent.Consents¶
XBR data consents.
- db¶
- idx_consent_by_member_adr: cfxdb.xbr.consent.IndexConsentByMemberAddress¶
Consents-by-members-address index with
(member_adr|bytes[20], joined|int) -> member_adr|UUIDmapping.
- idx_offer_by_key: cfxdb.xbrmm.offer.IndexOfferByKey¶
Index of key offers by key ID (rather than offer ID, as the object table is indexed by).
- idx_paying_channel_by_delegate: cfxdb.xbrmm.channel.IndexPayingChannelByDelegate¶
Maps from XBR provider delegate address to the currently active paying channel address for the given provider delegate.
- idx_paying_channel_by_recipient: cfxdb.xbrmm.channel.IndexPayingChannelByRecipient¶
Maps from XBR recipient address to the currently active paying channel address for the given recipient.
- idx_payment_channel_by_actor: cfxdb.xbrmm.channel.IndexPaymentChannelByActor¶
Maps from XBR consumer actor address to the currently active payment channel address for the given consumer actor.
- idx_payment_channel_by_delegate: cfxdb.xbrmm.channel.IndexPaymentChannelByDelegate¶
Maps from XBR consumer delegate address to the currently active payment channel address for the given consumer delegate.
- idx_user_key_by_member: cfxdb.xbrmm.userkey.IndexUserKeyByMember¶
Index “by pubkey” of user keys
xbrmm.IndexUserKeyByMember.
- ipfs_files: cfxdb.xbrmm.ipfs_file.IPFSFiles¶
IPFS files download log table
xbrmm.IPFSFiles.
- offers: cfxdb.xbrmm.offer.Offers¶
Data encryption key offers.
- paying_balances: cfxdb.xbrmm.channel.PayingChannelBalances¶
Current off-chain balances within paying channels.
- paying_channels: cfxdb.xbrmm.channel.PayingChannels¶
Paying channels for XBR provider delegates.
- payment_balances: cfxdb.xbrmm.channel.PaymentChannelBalances¶
Current off-chain balances within payment channels.
- payment_channels: cfxdb.xbrmm.channel.PaymentChannels¶
Payment channels for XBR consumer delegates.
- transactions: cfxdb.xbrmm.transaction.Transactions¶
- user_keys: cfxdb.xbrmm.userkey.UserKeys¶
User client keys database table
xbrmm.UserKeys.
- class Transaction(from_fbs=None)[source]¶
Bases:
objectData encryption key buy-sell transactions.
- STATUS_FAILED = 2¶
The transaction has completed with error (it failed)
- STATUS_INFLIGHT = 1¶
The transaction is currently in-flight
- STATUS_NONE = 0¶
Unset
- STATUS_SUCCESS = 3¶
The transaction has completed with success
- _amount = None¶
- _buyer_pubkey = None¶
- _completed = None¶
- _completed_paying_channel_seq = None¶
- _completed_payment_channel_seq = None¶
- _created = None¶
- _created_paying_channel_seq = None¶
- _created_payment_channel_seq = None¶
- _from_fbs = None¶
- _key = None¶
- _offer = None¶
- _paying_channel = None¶
- _paying_channel_after = None¶
- _paying_del_sig = None¶
- _paying_mm_sig = None¶
- _payment_channel = None¶
- _payment_channel_after = None¶
- _payment_del_sig = None¶
- _payment_mm_sig = None¶
- _state = None¶
- _tid = None¶
- property completed: numpy.datetime64¶
Completion time of the transaction (epoch time in ns)
- property completed_paying_channel_seq: int¶
Sequence number of the completed-state transaction within the paying channel.
- property completed_payment_channel_seq: int¶
Sequence number of the completed-state transaction within the payment channel.
- property created: numpy.datetime64¶
Creation time of the transaction (epoch time in ns).
- property created_paying_channel_seq: int¶
Sequence number of the created-state transaction within the paying channel.
- property created_payment_channel_seq: int¶
Sequence number of the created-state transaction within the payment channel.
- property paying_channel: uuid.UUID¶
Address of the paying channel (of the seller) this transaction is transacting on.
- property payment_channel: uuid.UUID¶
Address of the payment channel (of the buyer) this transaction is transacting on.
- class Transactions(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapUuidFlatBuffersData encryption key (off-chain) market transactions.
- class UserKey(from_fbs=None)[source]¶
User client (public) keys.
- _created = None¶
- _from_fbs = None¶
- _owner = None¶
- _pubkey = None¶
- _signature = None¶
- _wallet_address = None¶
- property created: numpy.datetime64¶
Timestamp (epoch time in ns) of initial creation of this record.
- class UserKeys(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
zlmdb.MapBytes32FlatBuffersDatabase table for user client keys.