Network

Blockchain


class Attribute(from_fbs=None)[source]

Bases: object

Generic meta-data attributes that can be stored on objects in tables.

property attribute: str

Attribute name (part of the key).

property modified: datetime64

Timestamp when the attribute was last modified (or first created).

property object_oid: UUID

Object (within the table) holding the attribute.

property table_oid: UUID

Table of the object holding the attribute.

property value

Arbitrary attribute value, stored CBOR-serialized.

class 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) to cfxdb.meta.Attribute

class 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 block_hash: bytes

Block hash.

property block_number: int

block number.

Type:

Primary key

property cnt_events: int

Number of XBR blockchain log events found in the block.

property timestamp: datetime64

Timestamp when record was inserted (Unix epoch time in ns).

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

Bases: MapBytes32FlatBuffers

Blockchain blocks processed.

Map zlmdb.MapBytes32FlatBuffers from block_number to cfxdb.xbr.Block

class TokenApproval(from_fbs=None)[source]

Bases: object

IERC20.TokenApproval event database object.

property block_hash: bytes

Block hash.

property owner_address: bytes

XBR token sending address.

property spender_address: bytes

XBR token receiving address.

property tx_hash: bytes

Transaction hash.

Type:

Primary key

property value: int

XBR token transferred.

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

Bases: MapBytes32FlatBuffers

Persisted token approvals archive.

Map zlmdb.MapBytes32FlatBuffers from transaction_hash to cfxdb.xbr.TokenApproval

class TokenTransfer(from_fbs=None)[source]

Bases: object

IERC20.TokenTransfer event database object.

property block_hash: bytes

Block hash.

property from_address: bytes

XBR token sending address.

property to_address: bytes

XBR token receiving address.

property tx_hash: bytes

Transaction hash.

Type:

Primary key

property value: int

XBR token transferred.

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

Bases: MapBytes32FlatBuffers

Persisted token transfers archive.

Map zlmdb.MapBytes32FlatBuffers from transaction_hash to cfxdb.xbr.TokenTransfer

Network


class Member(from_fbs=None)[source]

Bases: object

XBR Network member database object.

property account_oid: UUID

ID of user account this member has an account on planet.xbr.network.

property address: bytes

Ethereum address of the member.

property eula: str

EULA the member agreed to when joining the market (IPFS Multihash string).

property level: int

Current member level.

property profile: str

Optional member profile (IPFS Multihash string).

property registered: int

Block number (on the blockchain) when the member (originally) registered.

property signature: bytes

When signed off-chain and submitted via XBRNetwork.registerMemberFor.

property tid: bytes

Transaction hash of the transaction this change was committed to the blockchain under.

property timestamp: datetime64

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

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

Bases: MapBytes20FlatBuffers

XBR members by member_adr.

Map zlmdb.MapBytes20FlatBuffers from member_adr to cfxdb.xbr.Member

class Market(from_fbs=None)[source]

Bases: object

XBRNetwork.Market database object.

property coin: bytes

Market coin.

property consumer_security: int

The amount of XBR tokens a XBR consumer joining the market must deposit.

property created: int

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

property maker: bytes

The address of the XBR market maker that will run this market. The delegate of the market owner.

property market: UUID

The unique ID of the market.

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.

property meta: str

The XBR market metadata published by the market owner. IPFS Multihash pointing to a RDF/Turtle file with market metadata.

property owner: bytes

Market owner.

property provider_security: int

The amount of XBR tokens a XBR provider joining the market must deposit.

property seq: int

Global market sequence number.

property signature: bytes

When signed off-chain and submitted via XBRMarket.createMarketFor.

property terms: str

The XBR market terms set by the market owner. IPFS Multihash pointing to a ZIP archive file with market documents.

property tid: bytes

Transaction hash of the transaction this change was committed to the blockchain under.

property timestamp: datetime64

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

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

Bases: MapUuidFlatBuffers

Markets table, mapping from market_id|UUID to cfxdb.xbr.Market

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

Bases: MapBytes20TimestampUuid

Markets-by-owner index with (owner_adr|bytes[20], created|int) -> market_id|UUID mapping.

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

Bases: MapBytes20TimestampUuid

Markets-by-actor index with (actor_adr|bytes[20], joined|int) -> market_id|UUID mapping.

class Actor(from_fbs=None)[source]

Bases: object

XBR Market Actors.

property actor: bytes

Ethereum address of the member.

property actor_type: int

Type of the market actor.

property joined: int

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

property market: UUID

ID of the market this actor is associated with.

property meta: str

The XBR market metadata published by the market owner. IPFS Multihash pointing to a RDF/Turtle file with market metadata.

property security: int

Security (XBR tokens) deposited by the actor in the market.

property signature: bytes

When signed off-chain and submitted via XBRMarket.joinMarketFor.

property tid: bytes

Transaction hash of the transaction this change was committed to the blockchain under.

property timestamp: datetime64

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

class 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) to cfxdb.xbr.Actor.

Account


class Account(from_fbs=None)[source]

Bases: object

XBR Network members.

ACCOUNT_LEVEL = [0, 1, 2, 3, 4, 5]

Valid account levels.

ACCOUNT_LEVEL_ACTIVE = 1

Account is active.

ACCOUNT_LEVEL_BLOCKED = 5

Account is currently blocked and cannot current actively participate in the market.

ACCOUNT_LEVEL_NONE = 0

Unset.

ACCOUNT_LEVEL_PENALTY = 4

Account is subject to a temporary penalty.

ACCOUNT_LEVEL_RETIRED = 3

Account is retired.

ACCOUNT_LEVEL_VERIFIED = 2

Account is active and verified.

WALLET_TYPE = [0, 1, 2, 3]

Valid account wallet types.

WALLET_TYPE_FROM_STRING = {'hosted': 3, 'imported': 1, 'metamask': 2, 'none': 0}

Map of wallet-type-name to wallet-type-code.

WALLET_TYPE_HOSTED = 3

Account wallet in hosted (in this database).

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_NONE = 0

Wallet type unset (“null”).

WALLET_TYPE_TO_STRING = {0: 'none', 1: 'imported', 2: 'metamask', 3: 'hosted'}

Map of wallet-type-code to wallet-type-name.

property created: datetime64

Timestamp (epoch time in ns) of initial creation of this record.

property email: str

User (primary) email address.

property email_verified: datetime64

Timestamp (epoch time in ns) when the user email was (last) verified or 0 if unverified.

property eula: str

EULA the member agreed to when joining the market (IPFS Multihash string).

property level: int

Current member level.

property oid: UUID

Globally unique and static member ID.

property profile: str

Optional member profile (IPFS Multihash string).

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 recovery_salt: bytes

Salt used for encryption of recovery data.

property registered: int

Block number (on the blockchain) when the member (originally) registered.

property username: str

//xbr.network)

Type:

XBR Network username (must be globally unique on https

property wallet_address: bytes

Public address of user crypto wallet in use.

property wallet_type: int

Type of (primary) user crypto wallet in use.

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

Bases: MapUuidFlatBuffers

Database table for XBR member accounts.

static parse(data)[source]
Parameters:

data

Returns:

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

Bases: MapStringUuid

Database (index) table for username-to-account mapping.

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

Bases: MapStringUuid

Database (index) table for (user-)email-to-account mapping.

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

Bases: MapBytes20Uuid

Database (index) table for (user-)wallet-to-account mapping.

VerifiedAction


class 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_STATUS = [0, 1, 2, 3, 4]

All valid verification status codes.

VERIFICATION_STATUS_EXPIRED = 4

Action cannot be verified any longer since it has expired.

VERIFICATION_STATUS_FAILED = 3

Verification has failed.

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_TYPE = [0, 1, 2, 3, 4, 5, 6]

All valid verification action types.

VERIFICATION_TYPE_CREATE_CATALOG = 5

Verification action type for creation of a catalog 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_LOGIN_MEMBER = 2

Verification action type for login of member (client) via email verification.

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_PUBLISH_API = 5

Verification action type for publishing on API via email verification.

property created: datetime64

Timestamp (epoch time in ns) of initial creation of this record.

property oid: UUID

Globally unique and static ID of action.

property vcode: str

Verification code sent.

property verified_data: dict

Action data, serialized in CBOR.

property verified_oid: UUID

ID of object of verified action.

property vstatus: int

Verification type.

property vtype: int

Verification type.

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

Bases: MapUuidFlatBuffers

Database table for verification/verified actions, eg on-boarding new XBR members.

static parse(data)[source]
Parameters:

data

Returns:

UserKey


class 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.

property owner: UUID

ID of user account this user key is owned by.

property pubkey: bytes

User key - a Ed25519 public key - for authenticating using WAMP-cryptosign.

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

Bases: MapBytes32FlatBuffers

Database table for user client keys.

static parse(data)[source]
Parameters:

data

Returns:

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

Bases: MapUuidTimestampBytes32

Database (index) table for (member_oid, created) -> userkey mapping.