Listing class

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

Bases: starfish.listing.listing_base.ListingBase

Create a Listing object

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

  • did (str) – did of the listing, this can be the did of the underling asset.

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

  • data (dict) – data of the listing

  • ddo – Optional ddo for the listing

property get_purchase_ids: str
property is_published: bool

Return a True if this listing is published

Returns

True of False if this listing is published

Type

boolean

is_purchased(account: starfish.network.account_base.AccountBase) bool

Return true if the account has already purchased this listing/asset

Parameters

account (Account) – account to test for this purchase of this asset.

Returns

result if has purchased this asset

Type

boolean

purchase(account: starfish.network.account_base.AccountBase) bool

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

set_published(value: bool) None

Set the published value

Params boolean value

Published value True or False