Skip to main content

core.classes.marketplace_direct

MarketplaceDirect Objects

class MarketplaceDirect(BaseContract[Marketplace])

get_listing

def get_listing(listing_id: int) -> DirectListing

Get a direct listing from the marketplace by ID

Arguments:

  • listing_id: The ID of the listing to get

Returns:

The listing

get_active_offer

def get_active_offer(listing_id: int, address: str) -> Optional[Offer]

Get an active offer for a direct listing

Arguments:

  • listing_id: The ID of the listing to get the offer for
  • address: The address of the user to get the offer for

Returns:

The offer

create_listing

def create_listing(listing: NewDirectListing) -> int

Create a new direct listing

Arguments:

  • listing: The listing to create

Returns:

The ID of the listing

make_offer

def make_offer(
listing_id: int,
quantity_desired: int,
currency_contract_address: str,
price_per_token: Price,
expiration_date: int = int(MAX_INT, 0)) -> TxReceipt

Make an offer on a direct listing

Arguments:

  • listing_id: The ID of the listing to make the offer on
  • quantity_desired: The quantity desired
  • currency_contract_address: The address of the currency contract
  • price_per_token: The price per token

Returns:

The transaction receipt

accept_offer

def accept_offer(listing_id: int, address_or_offerror: str) -> TxReceipt

Accept a direct listing offer

Arguments:

  • listing_id: The ID of the listing to accept the offer on
  • address_or_offerror: The address of the user to accept the offer for

Returns:

The transaction receipt

buyout_listing

def buyout_listing(listing_id: int,
quantity_desired: int,
receiver: Optional[str] = None) -> TxReceipt

Buyout a direct listing by ID

Arguments:

  • listing_id: The ID of the listing to buyout
  • quantity_desired: The quantity desired
  • receiver: The address of the user to receive the tokens

Returns:

The transaction receipt

update_listing

def update_listing(listing: DirectListing) -> TxReceipt

Update a direct listing

Arguments:

  • listing: The listing to update

Returns:

The transaction receipt

cancel_listing

def cancel_listing(listing_id: int) -> TxReceipt

Cancel a direct listing

Arguments:

  • listing_id: The ID of the listing to cancel

Returns:

The transaction receipt