hiveengine - improved NFT handling

in HiveDevs4 years ago (edited)

Repository

<p dir="auto"><span><a href="https://github.com/holgern/hiveengine" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/holgern/hiveengine <p dir="auto"><img src="https://images.hive.blog/DQmQjrubpzar2XPwN8Uj4jZBPTbu8dsnh8t3qU7d321k9bV/pypi%20header" alt="pypi header" /> <h2>hiveengine <p dir="auto"><a href="https://github.com/holgern/hiveengine" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">hiveengine is a python library for working with <a href="https://hive-engine.com/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">hive-engine.com tokens and NFTs. <p dir="auto">I released version 0.2.2 which can be installed by <pre><code>pip install hiveengine <p dir="auto">hiveengine is using <a href="https://github.com/holgern/beem" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">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 <pre><code>beempy config <p dir="auto">Hive nodes can be set with <pre><code>beempy updatenodes --hive <p dir="auto">Using the beem wallet for key storage simplifies broadcasting. You can use <pre><code>beempy createwallet <p dir="auto">and <pre><code>beempy addkey <p dir="auto">for this. Whenever you want to broadcast something with beempy/hiveengine, you can now enter your wallet password. <h2>Changelog <ul> <li>fix hiveengine info for NFT symbols <li>add min-hive parameter to nftsellbook <li>add cheapest-only parameter to nftsellbook <li>Read groupBy when grouping is empty in nftsellbook <li>update_url, update_metadata, update_name, update_org_name, update_product_name, add_authorized_issuing_accounts,<br /> add_authorized_issuing_contracts, remove_authorized_issuing_accounts, remove_authorized_issuing_contracts,<br /> transfer_ownership, add_property, set_property_permissions, set_properties, set_group_by,<br /> update_property_definition, issue, issue_multiple, enable_delegation added to Nft <li>New nft command to view properties of an NFT object <li>Fix nfttrades command and lists a trades summary when now symbol was given <li>Add interactive mode to nftsellbook for buy, cancel or change price <h2>How to use the hiveengine to sell cards <p dir="auto">We need at first the nft-id of the cards:<br /> <img src="https://images.hive.blog/DQmNhaM1DJ3NgctgrX9UXyvuYvffE45TtPYoCyQFMpFJE8e/nft%20id%20example" alt="nft id example" /> <pre><code>hiveengine nftsell -a holger80 star 9081 9290 750 STARBITS <p dir="auto">There will be always a confirm dialog:<br /> <img src="https://images.hive.blog/DQmUpYduTM5xQrp7v7QQ5Txf5kM2FxU31nepxJzx3eM6CU3/output%20of%20ntfsell" alt="output of ntfsell" /><br /> When continue, the operation will be broadcasted and a trx_id is returned:<br /> <img src="https://images.hive.blog/DQmSGUYq4XhktYBkg9BS22k6T5rUik8Gspc7KafMrorGMsX/broadcasted%20op" alt="broadcasted op" /><br /> I can now copy the trx-id and check if the putting my nfts to the market was successfully: <pre><code>hiveengine info 13441d81fbf462cb31d7fec3de690069e224158c <h2>How to use hiveengine to cancel all entries at once <p dir="auto">Currently, when I want to cancel offers on the market for risingstar, I have to do it for every nft one by one.<br /> <img src="https://images.hive.blog/DQmUySwpkFNQrdU9cFMbTTGYm7Fth7fFXy6KEgkPH6YYZEY/market%20example" alt="market example" /><br /> hiveengine can be used to simplify this:<br /> First I need the correct property name: <pre><code>hiveengine nftsellbook -a holger80 star <p dir="auto"><img src="https://images.hive.blog/DQmXBaEKapabh8rzMKHwo6Eza3dWgKC8nQVM8Sjg3zD9FoB/output%20of%20nftsellbook" alt="output of nftsellbook" /><br /> I can find out the current cheapest price with: <pre><code>hiveengine nftsellbook -g type -v "i3 Cheap Keyboard" -i star <p dir="auto">now I can cancel all my offers at once: <pre><code>hiveengine nftsellbook -a holger80 -g type -v "i3 Cheap Keyboard" -i star <p dir="auto">The <code>--interactive or <code>-i parameter adds the possibility to broadcast a buy, cancel or change price operation on all shown entries:<br /> <img src="https://images.hive.blog/DQmVcmbV7GHJ3dnH9goyHtjChTx94jVvavUSdEF2a5swzsw/output%20of%20nftsellbook%20with%20interactive" alt="output of nftsellbook with interactive" /> <p dir="auto"><code>hiveengine collection holger80 shows now<br /> <img src="https://images.hive.blog/DQmYcmCU5xpinmYmSTZCLYccuWXU2MrSBm8DTqFC8iyAvne/nft%20collection" alt="nft collection" /><br /> and I select all nftIds but the first entry and copy/paste it into the following command: <pre><code>hiveengine nftsell -a holger80 --fee 100 star 7247 7670 8229 8232 8235 1490 STARBITS <p dir="auto">I could now improve my position:<br /> <img src="https://images.hive.blog/DQmRVcpidpUhqPyZSeFdtGYgB4zrUBofGoir5DNyB42MZ3k/result" alt="result" /> <h2>Buying cards with the interactive mode <p dir="auto">The following command allows it to buy the cheapest <code>Can of Patrol card with STARBITS: <pre><code>hiveengine nftsellbook -g type -v "Can Of Petrol" -s starbits -l 1 -i star <p dir="auto"><img src="https://images.hive.blog/DQmeHNGUbaLgCkCUb8WjT4CWWvx7V1fWs11H7898SJVCz3T/output%20of%20nftsellbook" alt="output of nftsellbook" /> <h2>Check how many NFT were bought the last 24 hours <pre><code> hiveengine nfttrades star <p dir="auto">returns all trades of the last 24 hours for the given symbol.<br /> <img src="https://images.hive.blog/DQmb3JgM1ww2zoLnvun7LkmQPrF1iN2vuLJFqrzVqEeXgjL/output%20of%20nfttrades" alt="output of nfttrades" /><br /> A summary is also given. <p dir="auto">The following command <pre><code>hiveengine nfttrades <p dir="auto">returns a summary for all NFT symbols:<br /> <img src="https://images.hive.blog/DQmawd6r3LZPMUZsXy9VNrKMmjpekof7k9KHR7P3gPQMXMJ/summary" alt="summary" /> <h2>Checking a single NFT <p dir="auto">The following commands can be used to check the newest generated NFT: <pre><code>hiveengine nftinfo nftsr <p dir="auto"><img src="https://images.hive.blog/DQmT1zrn7AqLVkz9Eqq7nwtK5hkYTvp9HtjpmEUACxcHrsy/nftinfo" alt="nftinfo" /><br /> shows that the newest NFT has the ID 443. <pre><code>hiveengine nft nftsr 443 <p dir="auto"><img src="https://images.hive.blog/DQmckcdxbmd9vFNBQZBgtV1GtzBdJXaQe4dk5v5rG9BuMHy/info%20about%20nft%20id" alt="info about nft id" /><br /> You can view the NFT on nftshowroom by adding the artSeries parameter to <code>https://nftshowroom.com/market/. For this ID, is is <code>https://nftshowroom.com/market/barbarabezina_gif_awake <a href="https://nftshowroom.com/market/barbarabezina_gif_awake" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">link. <h2>More NFT related custom_json commands have been added <p dir="auto">Move NFT related commands have been added to <code>Nft <pre><code>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) <p dir="auto">Please read the official documentation <a href="https://github.com/hive-engine/steemsmartcontracts-wiki/blob/master/NFT-Contracts.md" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">NFT-Contracts.md and check the output with <code>Hive(no_broadcast=True). <p dir="auto">The names and parameter have been changed from camelcase to underscore: <code>updateMetadata -> <code>update_metadata and <code>isReadOnly -> <code>is_read_only. <p dir="auto">The following custom_json that have to be broadcasted by the owner have added: <pre><code>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") <p dir="auto">It is also possible to issue new NFTs and change properties of an issued NFT: <pre><code>nft.issue("user_a", "PAL") nft.set_properties([{ "id":"573", "properties": {"color": "red", "level": 2}}], authorized_account="satoshi") <hr /> <p dir="auto"><em>If you like what I do, consider casting a vote for me as witness on <a href="https://hivesigner.com/sign/account-witness-vote?witness=holger80&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Hivesigner or on <a href="https://peakd.com/witnesses" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PeakD
Sort:  

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?


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!Hi @holger80, you have received a small bonus upvote from MAXUV.

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

we love improvements ehehe

Posted using Dapplr

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

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

<table><tr><td><img src="https://images.hive.blog/60x60/http://hivebuzz.me/badges/toppayoutday.png" /><td>Your post got the highest payout of the day <p dir="auto"><sub><em>You can view <a href="https://hivebuzz.me/@holger80" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">your badges on your board And compare to others on the <a href="https://hivebuzz.me/ranking" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Ranking<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <h6>Support the HiveBuzz project. <a href="https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22109%22%5D&approve=true" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Vote for <a href="https://peakd.com/me/proposals/109" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">our proposal!