Class Facade

Package: keychain.core.facade

Inheritance: Facade

Description

Facade encapsulates the methods in common between personas and contacts for use in methods that can take either object. This class provides basic information about the related keychains such as the maturity (blockchain confirmation) level of the two keychains and the base URI.

The distinction between a persona and a contact is that a Gateway creates a persona and manages its keychains locally whereas a contact is created by another device.

In v2 of Keychain the contact and persona are not differentiated at a class level, but some methods expect one or the other. Please be careful not to pass a Facade representing a persona to a method expecting a contact, or vice versa.

Facade objects are not constructed by the user directly. They are created through the Gateway by adding, creating or retrieving personas and contacts.

In fact, Facade is a snapshot view of the underlying object at the time it is created or requested, because Facade has no reference to the Gateway or blockchain at all. This means developers should always refresh their view of the object using the appropriate method to obtain a new object before acting on it.

Since: v2.0

Public Member Functions

Return type Method and Description

str

name()

Returns the Facade name

PersonaStatus

status()

Returns the Facade blockchain confirmation status

str

subname()

Returns the Facade subname

Uri

uri()

Returns the blockchain URI

bool

is_mature()

Returns True if the Facade status is mature on the blockchain

bool

is_null()

Returns True if the Facade is NULL in the Keychain library, or otherwise represents a NULL sentinel object

Public Member Functions Detail

name

name() → str

Returns the Facade name, which is a local attribute initially associated with the Facade at its creation time.

Returns:

The Facade name

Raises:

KeychainError - if the Keychain library ran into an error preventing success

status

status() → PersonaStatus

Returns the Facade blockchain confirmation status

Returns:

The Facade status on the blockchain

subname

subname() → str

Returns the Facade subname, which is a local attribute initially associated with the Facade at its creation time.

Returns:

The Facade subname

Raises:

KeychainError - if the Keychain library ran into an error preventing success

uri

uri() → Uri

Returns the Uri associated with the Facade

Returns:

The Facade Uri

Raises:

KeychainError - if the Keychain library ran into an error preventing success

is_mature

is_mature() → bool

Returns True if the Facade is deemed mature. This generally means it has a PersonaStatus of CONFIRMED

Returns:

True if it is mature

is_null

is_null() → bool

Returns True if the Facade is NULL in the Keychain library, or otherwise represents a NULL sentinel object

Returns:

True if this Facade is NULL or a NULL sentinel object