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