hiveengine - NFT support has been added

in HiveDevs4 years ago

Repository

https://github.com/holgern/hiveengine

hiveengine

hiveengine is a python library for working with hive-engine.com tokens and NFTs.

I released version 0.2.1 which can be installed by

pip install hiveengine

hiveengine is using beem for broadcasting transfers and custom_json to the HIVE blockchain. hiveengine is only working when using HIVE nodes. You can check the currently set nodes with

beem config

Hive nodes can be set with

beem updatenodes --hive

Changelog

0.2.1

  • Fix nft_id list in nftbuy, nftcancel, nftchangeprice and nftsell

0.2.0

  • add NFT support has been added (collection, nft, nftmarket, nfts)
  • add NFT related commands to cli (collection, nftbuy, nftcancel, nftchangeprice, nftlist, nftopen, nftparams, nftsell, nftsellbook, nfttrades)

NFT support has been added to the command line tool

NFT support has been added to hiveengine in version 0.2.0. The following NFT related commands have been added.

collection

Usage: hiveengine collection [OPTIONS] ACCOUNT [SYMBOL]...

  Return NFT collection for an account

For example:

hiveengine collection holger80 CITY

which returns

NFT: CITY
+-------+---------------+---------------------------------------------------------------------+
| _id   | lockedTokens  | properties                                                          |
+-------+---------------+---------------------------------------------------------------------+
| 12659 | {'SIM': '20'} | {'name': 'Basic Home', 'population': 4, 'income': 1, 'type': '1st'} |
+-------+---------------+---------------------------------------------------------------------+

nftbuy

Usage: hiveengine nftbuy [OPTIONS] SYMBOL [NFT_IDS]...

  Buy nfts from the market

Options:
  -a, --account TEXT         Buy with this account (defaults to
                             "default_account")

  -m, --market_account TEXT  Market account which will receive the fee
                             (defaults to "nftmarket")

  -y, --yes                  Answer yes to all questions

The market account can be set to any account except the seller. The market account will receive the fees, when the token was successfully bought.

hiveengine default value for the market account is @nftmarket, which was created by me. I will decide later what to do with received token. When I figure it out to which buyer to received tokens are connected, @nftmarket would share 50% of the received fees with the buyer (the received fees are excluded from token transfer history).

Setting the market account can be used to send the fee to an alt account:

hiveengine nftbuy -a holger80 -m my_alt STAR 100

In this case, holger80 will receive the NFT 100 and my_alt will receive the fee share in tokens.

nftcancel

Usage: hiveengine nftcancel [OPTIONS] SYMBOL [NFT_IDS]...

  Cancel a nft sell order

Options:
  -a, --account TEXT  Buy with this account (defaults to "default_account")
  -y, --yes           Answer yes to all questions

This command can be used to cancel an open order:

hiveengine nftcancel -a holger80 STAR 7147

which asks me to proceed:

Canceling selling of following nfts:
+-------+-----------------+----------------------------------------------------------------+
| nftId | previousAccount | properties                                                     |
+-------+-----------------+----------------------------------------------------------------+
| 7147  | holger80        | {'type': 'FanBoost1', 'class': 'fanboost', 'stats': '1,0,0,0'} |
+-------+-----------------+----------------------------------------------------------------+
continue [y/n]?

nftchangeprice

Usage: hiveengine nftchangeprice [OPTIONS] SYMBOL [NFT_IDS]... NEWPRICE

  Changes a price of an open sell order

Options:
  -a, --account TEXT  Buy with this account (defaults to "default_account")
  -y, --yes           Answer yes to all questions

The following command changes the price of my order to 1160 STARBITS:

hiveengine nftchangeprice -a holger80 STAR 7147 1160

nftlist

hiveengine nftlist

returns all existing NFTs:

+----+---------+-----------------------------+
| id | Symbol  | Name                        |
+----+---------+-----------------------------+
| 1  | CITY    | dCITY NFT TOKEN             |
| 2  | CRITTER | Mischievous Crypto Critters |
| 3  | STAR    | Rising Star Game            |
| 4  | MUSIC   | Music                       |
| 5  | API     | dCITY API                   |
| 6  | NFTSR   | NFT Showroom                |
+----+---------+-----------------------------+

nftopen

Usage: hiveengine nftopen [OPTIONS] SYMBOL

  Returns the open interest book for the given symbol

Options:
  -g, --grouping TEXT      Can be set to a grouping parameter, or to
                           parameter.value

  -v, --value TEXT         Set property value, can be used when grouping is
                           set to a property parameter

  -s, --price-symbol TEXT  Limit to this price symbol

This command returns the currently open orders for each NFT type.

hiveengine nftopen -g name -v "Basic Home" CITY

would return the open orders for one specific NFT type:

+-------------+---------------------------------------+-------+
| priceSymbol | grouping                              | count |
+-------------+---------------------------------------+-------+
| SIM         | {'name': 'Basic Home', 'type': ''}    | 0     |
| BEER        | {'name': 'Basic Home', 'type': ''}    | 0     |
| SWAP.HIVE   | {'name': 'Basic Home', 'type': ''}    | 0     |
| SWAP.STEEM  | {'name': 'Basic Home', 'type': ''}    | 0     |
| STARBITS    | {'name': 'Basic Home', 'type': ''}    | 0     |
| LEO         | {'name': 'Basic Home', 'type': ''}    | 0     |
| SWAP.HIVE   | {'name': 'Basic Home', 'type': '1st'} | 344   |
| SIM         | {'name': 'Basic Home', 'type': '1st'} | 1194  |
| BEER        | {'name': 'Basic Home', 'type': '1st'} | 1     |
| WEED        | {'name': 'Basic Home', 'type': '1st'} | 1     |
| STEM        | {'name': 'Basic Home', 'type': '1st'} | 0     |
| SWAP.STEEM  | {'name': 'Basic Home', 'type': '1st'} | 0     |
+-------------+---------------------------------------+-------+

nftparams

hiveengine nftparams

returns the fees for creating NFTs:

+-------------------------+----------------------------------+
| key                     | value                            |
+-------------------------+----------------------------------+
| _id                     | 1                                |
| nftCreationFee          | 100                              |
| nftIssuanceFee          | {'BEE': '0.001', 'PAL': '0.001'} |
| dataPropertyCreationFee | 100                              |
| enableDelegationFee     | 1000                             |
+-------------------------+----------------------------------+

nftsell

Usage: hiveengine nftsell [OPTIONS] SYMBOL [NFT_IDS]... PRICE PRICE_SYMBOL

  Create a sell order on the market

Options:
  -a, --account TEXT  Buy with this account (uses the beem default account
                      when not set)

  -f, --fee INTEGER   Market fee 500 -> 5% (defaults is 500)
  -y, --yes           Answer yes to all questions

This command creates a new sell order:

hiveengine nftsell -a holger80 STAR 7147 1150 STARBITS

and I can then check if it has worked by:

hiveengine nftsellbook -g type -v FanBoost1 -l 5 STAR

nftsellbook

Usage: hiveengine nftsellbook [OPTIONS] SYMBOL

  Returns the sell book for the given symbol

Options:
  -a, --account TEXT       Buy with this account (defaults to
                           "default_account")

  -g, --grouping TEXT      Can be set to a grouping parameter, or to
                           parameter.value

  -v, --value TEXT         Set property value, can be used when grouping is
                           set to a property parameter

  -s, --price-symbol TEXT  Limit to this price symbol
  -n, --nft-id TEXT        Limit to this nft id
  -l, --limit TEXT         Limit to shown entries

It is possible to limit the returned open sell orders by a specific property:

hiveengine nftsellbook -g name -v "Basic Home" -s SIM -l 10 CITY

will return the 10 cheapest offers for Basic Home NFTs which are sold by SIM tokens:

+--------+------------+------------+---------+-------------+--------+-----------+
| nftId  | account    | name       | price   | priceSymbol | fee    | est. HIVE |
+--------+------------+------------+---------+-------------+--------+-----------+
| 191946 | lestrange  | Basic Home | 329.000 | SIM         | 2.50 % | 1.704     |
| 191944 | lestrange  | Basic Home | 329.000 | SIM         | 2.50 % | 1.704     |
| 191941 | lestrange  | Basic Home | 329.000 | SIM         | 2.50 % | 1.704     |
| 191936 | lestrange  | Basic Home | 329.000 | SIM         | 2.50 % | 1.704     |
| 191902 | lestrange  | Basic Home | 329.000 | SIM         | 2.50 % | 1.704     |
| 194596 | bobawondua | Basic Home | 330.000 | SIM         | 2.50 % | 1.709     |
| 194587 | bobawondua | Basic Home | 330.000 | SIM         | 2.50 % | 1.709     |
| 194584 | bobawondua | Basic Home | 330.000 | SIM         | 2.50 % | 1.709     |
| 194582 | bobawondua | Basic Home | 330.000 | SIM         | 2.50 % | 1.709     |
| 194581 | bobawondua | Basic Home | 330.000 | SIM         | 2.50 % | 1.709     |
+--------+------------+------------+---------+-------------+--------+-----------+

I added the estimated HIVE token price to each order. The result table is sorted by the estimated HIVE price. This allows to check which offer has currently the best price. The HIVE price is calculated by using the last token price which is returned by the API.

nfttrades

Usage: hiveengine nfttrades [OPTIONS] [SYMBOL]

  Returns the trades history

Options:
  -a, --account TEXT  Buy with this account (defaults to "default_account")

This shows the last trades for a NFT symbol.


If you like what I do, consider casting a vote for me as witness on Hivesigner or on PeakD

Sort:  

wow, I've been waiting for someone to write code so I can tool around with dcity's nft market in python! This is awesome thank you for the update!

awesome news!

I am new to the platform and I consider myself a novice in this world, I would love to begin to obtain knowledge and know how to take full advantage of all this, any contribution or help would be welcome to develop in hive

Wow, that's pretty cool. I'm still learning to code myself and have yet to touch python. Can we also do something like this using JS for displaying on web?

Very extensive set of features. Excellent stuff. Having the equivalent HIVE price for market orders is something that I need to add to Rising Star at some point but who knows when that will be!

Rising Star The brand new Hive NFT game. Play for FREE now! That deserves a !BEER

Excellent development. Hive could be hub for NFTs. But hive-engine need to work on establishing decentralized nodes to increase trust.

This is awesome. I have my nft's but have not used them since Steem split.
I will check this out and rebuild some of my functionality.

This is actually super exciting for me.

what about as an NFT owner. issuing NFT's?
I use normal beem commands for that.

Nft owner related commands are still missing, I will add them in next (problem is that I cannot test them).

ahhh...
I have 3 different NFT's
I could make your account an issuer account to test.

Let me get in to them and I will post in the BEEM discord

By following these simple steps on this website, you can bring from $5000-$8000 of extra income every month... All you need is a computer and a internet connection and you are ready to start. Learn how to make a steady income for yourself on following web address ►►►►►►►► http://JobneWs3.com

Hi @holger80, you have received a small bonus upvote from MAXUV.
This is to inform you that you now have new MPATH tokens in your Hive-Engine wallet.
Please read this post for more information.
Thanks for being a member of both MAXUV and MPATH!

Congratulations @holger80! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You distributed more than 18000 upvotes. Your next target is to reach 19000 upvotes.

You can view your badges on your board And compare to others on the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Support the HiveBuzz project. Vote for our proposal!