Listing Base class

class starfish.listing.ListingBase(agent: starfish.agent.agent_base.AgentBase, listing_id: str, asset_did: str, data: Any, ddo: Optional[starfish.network.ddo.DDO] = None)

Bases: abc.ABC, Generic[starfish.types.ListingBase]

Create a Listing object

Parameters
  • agent (Agent object to assign to this Listing) – agent object that created the listing.

  • listing_id (str) – id of the listing.

  • asset_did (str) – the asset DID for this listing

  • data (dict) – data of the listing

  • ddo – Optional DDO object for this listing

property agent: starfish.agent.agent_base.AgentBase
Returns

Agent object that created this listing

Type

SquidAgent

property asset_did: str
Returns

asset DID held by the listing

Type

str

property data: Any
Returns

data of the listing

Type

dict or None

property ddo: starfish.network.ddo.DDO
Returns

ddo of the listing

Type

dict or None

property did: str
Returns

asset held did

Type

str

property is_empty: bool

Checks to see if this Listinng is empty.

Returns

True if this listing is empty else False.

Type

boolean

property listing_id: str
Returns

the listing id

Type

str or None

abstract purchase(account: starfish.network.account_base.AccountBase) None

Purchase the underlying asset within this listing using the account details, return a purchased asset with the service_agreement_id ( purchase_id ) set.

Parameters

account (Account) – account to use to purchase this asset.

Returns

SquidPurchase object that has information about this listing, asset and purcase id.

Type

SquidPurchase