Network¶
Blockchain¶
cfxdb.meta.Block
cfxdb.meta.Blocks
cfxdb.meta.TokenApproval
cfxdb.meta.TokenApprovals
cfxdb.meta.TokenTransfer
cfxdb.meta.TokenTransfers
- class cfxdb.meta.Attribute(from_fbs=None)[source]¶
Bases:
object
Generic meta-data attributes that can be stored on objects in tables.
- property modified: datetime64¶
Timestamp when the attribute was last modified (or first created).
- property value¶
Arbitrary attribute value, stored CBOR-serialized.
- class cfxdb.meta.Attributes(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapUuidUuidStringFlatBuffers
Generic meta-data attributes that can be stored on objects in tables. Primary key of this table is
(table_oid, object_oid, attribute)
.Map
zlmdb.MapUuidUuidStringFlatBuffers
from(table_oid, object_oid, attribute)
tocfxdb.meta.Attribute
- class cfxdb.xbr.Block(from_fbs=None)[source]¶
Bases:
object
Blockchain blocks. This table stores information about the series of Ethereum blocks that make up the blockchain.
- property timestamp: datetime64¶
Timestamp when record was inserted (Unix epoch time in ns).
- class cfxdb.xbr.Blocks(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapBytes32FlatBuffers
Blockchain blocks processed.
Map
zlmdb.MapBytes32FlatBuffers
fromblock_number
tocfxdb.xbr.Block
- class cfxdb.xbr.TokenApproval(from_fbs=None)[source]¶
Bases:
object
IERC20.TokenApproval
event database object.
- class cfxdb.xbr.TokenApprovals(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapBytes32FlatBuffers
Persisted token approvals archive.
Map
zlmdb.MapBytes32FlatBuffers
fromtransaction_hash
tocfxdb.xbr.TokenApproval
- class cfxdb.xbr.TokenTransfer(from_fbs=None)[source]¶
Bases:
object
IERC20.TokenTransfer
event database object.
- class cfxdb.xbr.TokenTransfers(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapBytes32FlatBuffers
Persisted token transfers archive.
Map
zlmdb.MapBytes32FlatBuffers
fromtransaction_hash
tocfxdb.xbr.TokenTransfer
Network¶
- class cfxdb.xbr.Member(from_fbs=None)[source]¶
Bases:
object
XBR Network member database object.
- property timestamp: datetime64¶
Database transaction time (epoch time in ns) of insert or last update.
- class cfxdb.xbr.Members(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapBytes20FlatBuffers
XBR members by
member_adr
.Map
zlmdb.MapBytes20FlatBuffers
frommember_adr
tocfxdb.xbr.Member
- class cfxdb.xbr.Market(from_fbs=None)[source]¶
Bases:
object
XBRNetwork.Market
database object.- property timestamp: datetime64¶
Database transaction time (epoch time in ns) of insert or last update.
- property created: int¶
Block number (on the blockchain) when the actor (originally) joined the market.
- property terms: str¶
The XBR market terms set by the market owner. IPFS Multihash pointing to a ZIP archive file with market documents.
- property meta: str¶
The XBR market metadata published by the market owner. IPFS Multihash pointing to a RDF/Turtle file with market metadata.
- property maker: bytes¶
The address of the XBR market maker that will run this market. The delegate of the market owner.
- property provider_security: int¶
The amount of XBR tokens a XBR provider joining the market must deposit.
- property consumer_security: int¶
The amount of XBR tokens a XBR consumer joining the market must deposit.
- property market_fee: int¶
The fee taken by the market (beneficiary is the market owner). The fee is a percentage of the revenue of the XBR Provider that receives XBR Token paid for transactions. The fee must be between 0% (inclusive) and 99% (inclusive), and is expressed as a fraction of the total supply of XBR tokens.
- class cfxdb.xbr.Markets(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapUuidFlatBuffers
Markets table, mapping from
market_id|UUID
tocfxdb.xbr.Market
- class cfxdb.xbr.IndexMarketsByOwner(slot=None, compress=None)[source]¶
Bases:
MapBytes20TimestampUuid
Markets-by-owner index with
(owner_adr|bytes[20], created|int) -> market_id|UUID
mapping.
- class cfxdb.xbr.IndexMarketsByActor(slot=None, compress=None)[source]¶
Bases:
MapBytes20TimestampUuid
Markets-by-actor index with
(actor_adr|bytes[20], joined|int) -> market_id|UUID
mapping.
- class cfxdb.xbr.Actor(from_fbs=None)[source]¶
Bases:
object
XBR Market Actors.
- property timestamp: datetime64¶
Database transaction time (epoch time in ns) of insert or last update.
- property joined: int¶
Block number (on the blockchain) when the actor (originally) joined the market.
- property meta: str¶
The XBR market metadata published by the market owner. IPFS Multihash pointing to a RDF/Turtle file with market metadata.
- class cfxdb.xbr.Actors(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapUuidBytes20Uint8FlatBuffers
Market actors table, mapping from
(market_id|UUID, actor_adr|bytes[20], actor_type|int)
tocfxdb.xbr.Actor
.
Account¶
- class cfxdb.xbrnetwork.Account(from_fbs=None)[source]¶
Bases:
object
XBR Network members.
- ACCOUNT_LEVEL_NONE = 0¶
Unset.
- ACCOUNT_LEVEL_ACTIVE = 1¶
Account is active.
- ACCOUNT_LEVEL_VERIFIED = 2¶
Account is active and verified.
- ACCOUNT_LEVEL_RETIRED = 3¶
Account is retired.
- ACCOUNT_LEVEL_PENALTY = 4¶
Account is subject to a temporary penalty.
- ACCOUNT_LEVEL_BLOCKED = 5¶
Account is currently blocked and cannot current actively participate in the market.
- ACCOUNT_LEVEL = [0, 1, 2, 3, 4, 5]¶
Valid account levels.
- WALLET_TYPE_NONE = 0¶
Wallet type unset (“null”).
- WALLET_TYPE_IMPORTED = 1¶
Account (primary) wallet was imported (the user provided the wallet public address).
- WALLET_TYPE_METAMASK = 2¶
Account (primary) wallet was imported (the user provided the wallet public address).
- WALLET_TYPE_HOSTED = 3¶
Account wallet in hosted (in this database).
- WALLET_TYPE = [0, 1, 2, 3]¶
Valid account wallet types.
- WALLET_TYPE_TO_STRING = {0: 'none', 1: 'imported', 2: 'metamask', 3: 'hosted'}¶
Map of
wallet-type-code
towallet-type-name
.
- WALLET_TYPE_FROM_STRING = {'hosted': 3, 'imported': 1, 'metamask': 2, 'none': 0}¶
Map of
wallet-type-name
towallet-type-code
.
- property recovery_algo: datetime64¶
Timestamp (epoch time in ns) of initial creation of this record.
- property recovery_data: bytes¶
Recovery backup data (usually encrypted according to the account backup recovery algo in use).
- property created: datetime64¶
Timestamp (epoch time in ns) of initial creation of this record.
- property username: str¶
XBR Network username (must be globally unique on https://xbr.network)
- property email_verified: datetime64¶
Timestamp (epoch time in ns) when the user email was (last) verified or 0 if unverified.
- class cfxdb.xbrnetwork.Accounts(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapUuidFlatBuffers
Database table for XBR member accounts.
- class cfxdb.xbrnetwork.IndexAccountsByUsername(slot=None, compress=None)[source]¶
Bases:
MapStringUuid
Database (index) table for username-to-account mapping.
- class cfxdb.xbrnetwork.IndexAccountsByEmail(slot=None, compress=None)[source]¶
Bases:
MapStringUuid
Database (index) table for (user-)email-to-account mapping.
- class cfxdb.xbrnetwork.IndexAccountsByWallet(slot=None, compress=None)[source]¶
Bases:
MapBytes20Uuid
Database (index) table for (user-)wallet-to-account mapping.
VerifiedAction¶
- class cfxdb.xbrnetwork.VerifiedAction(from_fbs=None)[source]¶
Bases:
object
User actions (such as “on-board new user”) yet to be verified. Actions to be verified are identified using their “Verification Action ID”. A verificatin email is sent to the (primary) email address of the user, and to verify, the user must click the verification link contained in the email. The verification link contains the verification action ID and code.
- VERIFICATION_TYPE_NONE = 0¶
Unset verification action type (“null”).
- VERIFICATION_TYPE_ONBOARD_MEMBER = 1¶
Verification action type for on-boarding new members via email verification.
- VERIFICATION_TYPE_LOGIN_MEMBER = 2¶
Verification action type for login of member (client) via email verification.
- VERIFICATION_TYPE_CREATE_MARKET = 3¶
Verification action type for creation of new data market via email verification.
- VERIFICATION_TYPE_JOIN_MARKET = 4¶
Verification action type for joining an existing market via email verification.
- VERIFICATION_TYPE_CREATE_CATALOG = 5¶
Verification action type for creation of a catalog via email verification.
- VERIFICATION_TYPE_PUBLISH_API = 5¶
Verification action type for publishing on API via email verification.
- VERIFICATION_TYPE = [0, 1, 2, 3, 4, 5, 6]¶
All valid verification action types.
- VERIFICATION_STATUS_NONE = 0¶
Unset verification action status (“null”).
- VERIFICATION_STATUS_PENDING = 1¶
Verification is still pending.
- VERIFICATION_STATUS_VERIFIED = 2¶
Verification has been successfully completed.
- VERIFICATION_STATUS_FAILED = 3¶
Verification has failed.
- VERIFICATION_STATUS_EXPIRED = 4¶
Action cannot be verified any longer since it has expired.
- VERIFICATION_STATUS = [0, 1, 2, 3, 4]¶
All valid verification status codes.
- property created: datetime64¶
Timestamp (epoch time in ns) of initial creation of this record.
- class cfxdb.xbrnetwork.VerifiedActions(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapUuidFlatBuffers
Database table for verification/verified actions, eg on-boarding new XBR members.
UserKey¶
- class cfxdb.xbrnetwork.UserKey(from_fbs=None)[source]¶
Bases:
object
User client (public) keys.
- property created: datetime64¶
Timestamp (epoch time in ns) of initial creation of this record.
- class cfxdb.xbrnetwork.UserKeys(slot=None, compress=None, build=None, cast=None)[source]¶
Bases:
MapBytes32FlatBuffers
Database table for user client keys.
- class cfxdb.xbrnetwork.IndexUserKeyByAccount(slot=None, compress=None)[source]¶
Bases:
MapUuidTimestampBytes32
Database (index) table for (member_oid, created) -> userkey mapping.