___|  _ \   |  |    |   |_ _|\ \     / ____|
 |     |   |  |  |    |   |  |  \ \   /  __|
 |   | |   | ___ __|  ___ |  |   \ \ /   |
\____|\___/     _|   _|  _|___|   \_/   _____| 

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

hiveengine - improved NFT handling

BY: @holger80 | CREATED: July 22, 2020, 9:03 p.m. | VOTES: 490 | PAYOUT: $95.81 | [ VOTE ]

Repository

https://github.com/holgern/hiveengine

[IMAGE: https://images.hive.blog/DQmQjrubpzar2XPwN8Uj4jZBPTbu8dsnh8t3qU7d321k9bV/pypi%20header]

hiveengine

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

I released version 0.2.2 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

beempy config

Hive nodes can be set with

beempy updatenodes --hive

Using the beem wallet for key storage simplifies broadcasting. You can use

beempy createwallet

and

beempy addkey

for this. Whenever you want to broadcast something with beempy/hiveengine, you can now enter your wallet password.

Changelog

How to use the hiveengine to sell cards

We need at first the nft-id of the cards:
[IMAGE: https://images.hive.blog/DQmNhaM1DJ3NgctgrX9UXyvuYvffE45TtPYoCyQFMpFJE8e/nft%20id%20example]

hiveengine nftsell -a holger80 star 9081 9290 750 STARBITS

There will be always a confirm dialog:
[IMAGE: https://images.hive.blog/DQmUpYduTM5xQrp7v7QQ5Txf5kM2FxU31nepxJzx3eM6CU3/output%20of%20ntfsell]
When continue, the operation will be broadcasted and a trx_id is returned:
[IMAGE: https://images.hive.blog/DQmSGUYq4XhktYBkg9BS22k6T5rUik8Gspc7KafMrorGMsX/broadcasted%20op]
I can now copy the trx-id and check if the putting my nfts to the market was successfully:

hiveengine info 13441d81fbf462cb31d7fec3de690069e224158c

How to use hiveengine to cancel all entries at once

Currently, when I want to cancel offers on the market for risingstar, I have to do it for every nft one by one.
[IMAGE: https://images.hive.blog/DQmUySwpkFNQrdU9cFMbTTGYm7Fth7fFXy6KEgkPH6YYZEY/market%20example]
hiveengine can be used to simplify this:
First I need the correct property name:

hiveengine nftsellbook -a holger80  star

[IMAGE: https://images.hive.blog/DQmXBaEKapabh8rzMKHwo6Eza3dWgKC8nQVM8Sjg3zD9FoB/output%20of%20nftsellbook]
I can find out the current cheapest price with:

hiveengine nftsellbook -g type -v "i3 Cheap Keyboard" -i star

now I can cancel all my offers at once:

hiveengine nftsellbook -a holger80 -g type -v "i3 Cheap Keyboard" -i star

The --interactive or -i parameter adds the possibility to broadcast a buy, cancel or change price operation on all shown entries:
[IMAGE: https://images.hive.blog/DQmVcmbV7GHJ3dnH9goyHtjChTx94jVvavUSdEF2a5swzsw/output%20of%20nftsellbook%20with%20interactive]

hiveengine collection holger80 shows now
[IMAGE: https://images.hive.blog/DQmYcmCU5xpinmYmSTZCLYccuWXU2MrSBm8DTqFC8iyAvne/nft%20collection]
and I select all nftIds but the first entry and copy/paste it into the following command:

hiveengine nftsell -a holger80 --fee 100 star  7247 7670 8229 8232 8235 1490 STARBITS

I could now improve my position:
[IMAGE: https://images.hive.blog/DQmRVcpidpUhqPyZSeFdtGYgB4zrUBofGoir5DNyB42MZ3k/result]

Buying cards with the interactive mode

The following command allows it to buy the cheapest Can of Patrol card with STARBITS:

hiveengine nftsellbook  -g type -v "Can Of Petrol"  -s starbits -l 1 -i star

[IMAGE: https://images.hive.blog/DQmeHNGUbaLgCkCUb8WjT4CWWvx7V1fWs11H7898SJVCz3T/output%20of%20nftsellbook]

Check how many NFT were bought the last 24 hours

 hiveengine nfttrades star
 ```
 returns all trades of the last 24 hours for the given symbol.
 ![output of nfttrades](https://images.hive.blog/DQmb3JgM1ww2zoLnvun7LkmQPrF1iN2vuLJFqrzVqEeXgjL/output%20of%20nfttrades)
A summary is also given. 

The following command

hiveengine nfttrades

returns a summary for all NFT symbols:
![summary](https://images.hive.blog/DQmawd6r3LZPMUZsXy9VNrKMmjpekof7k9KHR7P3gPQMXMJ/summary)

## Checking a single NFT
The following commands can be used to check the newest generated NFT:

hiveengine nftinfo nftsr

![nftinfo](https://images.hive.blog/DQmT1zrn7AqLVkz9Eqq7nwtK5hkYTvp9HtjpmEUACxcHrsy/nftinfo)
shows that the newest NFT has the ID 443.

hiveengine nft nftsr 443

![info about nft id](https://images.hive.blog/DQmckcdxbmd9vFNBQZBgtV1GtzBdJXaQe4dk5v5rG9BuMHy/info%20about%20nft%20id)
You can view the NFT on nftshowroom by adding the artSeries parameter to `https://nftshowroom.com/market/`. For this ID, is is `https://nftshowroom.com/market/barbarabezina_gif_awake` [link](https://nftshowroom.com/market/barbarabezina_gif_awake).

## More NFT related custom_json commands have been added
Move NFT related commands have been added to `Nft`

from hiveengine.nft import Nft
from beem import Hive
active_wif = "5xxxx"
posting_wif = "5xxxx"
hive = Hive(keys=[active_wif, posting_wif])
nft = Nft("TESTNFT", blockchain_instance=hive)

Please read the official documentation [NFT-Contracts.md](https://github.com/hive-engine/steemsmartcontracts-wiki/blob/master/NFT-Contracts.md) and check the output with `Hive(no_broadcast=True)`.

The names and parameter have been changed from camelcase to underscore: `updateMetadata` -> `update_metadata` and `isReadOnly` -> `is_read_only`.

The following custom_json that have to be broadcasted by the owner have added:

nft.update_url("https://new_url.com")
metadata = {"url": "https://mycoolnft.com",
"icon": "https://mycoolnft.com/token.jpg",
"desc": "This NFT will rock your world! It has features x, y, and z. So cool!"}
nft.update_metadata(metadata)
nft.update_name("My Awesome NFT")
nft.update_org_name("Nifty Company Inc")
nft.update_product_name("Acme Exploding NFTs")
nft.add_authorized_issuing_accounts(["satoshi","aggroed","cryptomancer"])
nft.add_authorized_issuing_contracts(["mycontract","anothercontract","mygamecontract"])
nft.remove_authorized_issuing_accounts(["aggroed","cryptomancer"])
nft.remove_authorized_issuing_contracts(["mycontract","mygamecontract"])
nft.transfer_ownership("aggroed")
nft.add_property("color", "string")
nft.set_property_permissions("color", accounts=["cryptomancer","marc"])
nft.set_group_by(["level", "isFood"])
nft.update_property_definition("color", new_name="Color")


It is also possible to issue new NFTs and change properties of an issued NFT:

nft.issue("user_a", "PAL")
nft.set_properties([{ "id":"573", "properties": {"color": "red", "level": 2}}], authorized_account="satoshi")
```

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

TAGS: [ #development ] [ #hive-engine ] [ #python ]

Replies

@maxuvv | July 22, 2020, 9:05 p.m. | Votes: 0 | [ VOTE ]

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!

@chasmic-cosm | July 22, 2020, 10:15 p.m. | Votes: 0 | [ VOTE ]

Awesome! Gonna dig into hive engine next week! looking forward to it! Thanks for the post

@sergiomendes | July 23, 2020, 1:07 a.m. | Votes: 0 | [ VOTE ]

we love improvements ehehe

Posted using Dapplr

@nsioscar | July 23, 2020, 11:38 a.m. | Votes: 0 | [ VOTE ]

Wow, hive engine this brought us new experience...

@marki99 | July 23, 2020, 1 p.m. | Votes: 2 | [ VOTE ]

What is the drawback of having smart contracts and NFTs on a second layer versus first layer?

I suppose it is less secure or decentralized in some way but why exactly?

@holger80 | July 23, 2020, 9:03 p.m. | Votes: 8 | [ VOTE ]

You can find a detailed post about first layer vs second layer here: https://peakd.com/hive/@blocktrades/hive-s-future-as-a-2nd-layer-blockchain-network

@hivebuzz | July 24, 2020, 12:33 a.m. | Votes: 0 | [ VOTE ]

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

Your post got the highest payout of the day

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!
[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>