nectarengine.nftmarket module

class nectarengine.nftmarket.NftMarket(api: Api | None = None, blockchain_instance: Any | None = None)

Bases: list

Access the hive-engine NFT market

Parameters:

blockchain_instance (Hive) – Hive instance

buy(symbol: str, account: str, nft_ids: List[str] | str, market_account: str) Dict[str, Any]

Buy nfts for given price.

Parameters:
  • symbol (str) – symbol

  • account (str) – account name

  • nft_ids (list) – list if token ids

  • market_account (str) – Account who receive the fee

  • price (float) – price

Buy example:

from nectarengine.nftmarket import NftMarket
from nectar import Hive
active_wif = "5xxxx"
hive = Hive(keys=[active_wif])
market = NftMarket(blockchain_instance=hive)
market.buy("STAR", "test", ["1"], "nftmarket")
cancel(symbol: str, account: str, nft_ids: List[str] | str) Dict[str, Any]

Cancel sell order.

Parameters:
  • symbol (str) – symbol

  • account (str) – account name

  • nft_ids (list) – list of tokens ids

Cancel example:

from nectarengine.nftmarket import NftMarket
from nectar import Hive
active_wif = "5xxxx"
hive = Hive(keys=[active_wif])
market = NftMarket(blockchain_instance=hive)
market.cancel("STAR", "test", ["1"])
change_price(symbol: str, account: str, nft_ids: List[str] | str, price: float) Dict[str, Any]

Change a price for a listed nft id

Parameters:
  • symbol (str) – nft symbol

  • account (str) – account name

  • nft_ids (list) – List of nfts

  • price (float) – new price

Sell example:

from nectarengine.nftmarket import NftMarket
from nectar import Hive
active_wif = "5xxxx"
hive = Hive(keys=[active_wif])
market = NftMarket(blockchain_instance=hive)
market.change_price("STAR", "test", ["1"], 30)
get_open_interest(symbol: str, side: str = 'sell', grouping_name: str | None = None, grouping_value: str | None = None, priceSymbol: str | None = None, limit: int | None = None) List[Dict[str, Any]]

Returns the sell book for a given symbol. When account is set, the order book from the given account is shown.

get_sell_book(symbol: str, account: str | None = None, grouping_name: str | None = None, grouping_value: str | None = None, priceSymbol: str | None = None, nftId: str | None = None, limit: int | None = None) List[Dict[str, Any]]

Returns the sell book for a given symbol. When account is set, the order book from the given account is shown.

get_trades_history(symbol: str, account: str | None = None, priceSymbol: str | None = None, timestamp: int | None = None) List[Dict[str, Any]]

Returns the trade history for a given symbol. When account is set, the trade history from the given account is shown.

sell(symbol: str, account: str, nft_ids: List[str] | str, price: float, price_symbol: str, fee: int) Dict[str, Any]

Sell token for given price.

Parameters:
  • symbol (str) – symbol

  • account (str) – account name

  • nft_ids (list) – List of nft ids

  • price (float) – price

  • price_symbol (str) – price symbol

  • fee (int) – fee percentage (500 -> 5%)

Sell example:

from nectarengine.nftmarket import NftMarket
from nectar import Hive
active_wif = "5xxxx"
hive = Hive(keys=[active_wif])
market = NftMarket(blockchain_instance=hive)
market.sell("STAR", "test", ["1"], 100, "STARBITS", 500)
set_id(ssc_id: str) None

Sets the ssc id (default is ssc-mainnet-hive)