hiveengine - improved NFT handling
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.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
- fix hiveengine info for NFT symbols
- add min-hive parameter to nftsellbook
- add cheapest-only parameter to nftsellbook
- Read groupBy when grouping is empty in nftsellbook
- update_url, update_metadata, update_name, update_org_name, update_product_name, add_authorized_issuing_accounts,
add_authorized_issuing_contracts, remove_authorized_issuing_accounts, remove_authorized_issuing_contracts,
transfer_ownership, add_property, set_property_permissions, set_properties, set_group_by,
update_property_definition, issue, issue_multiple, enable_delegation added to Nft - New nft command to view properties of an NFT object
- Fix nfttrades command and lists a trades summary when now symbol was given
- Add interactive mode to nftsellbook for buy, cancel or change price
How to use the hiveengine to sell cards
We need at first the nft-id of the cards:
hiveengine nftsell -a holger80 star 9081 9290 750 STARBITS
There will be always a confirm dialog:
When continue, the operation will be broadcasted and a trx_id is returned:
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.
hiveengine can be used to simplify this:
First I need the correct property name:
hiveengine nftsellbook -a holger80 star
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:
hiveengine collection holger80 shows now
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:
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
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.
A summary is also given.
The following command
hiveengine nfttrades
returns a summary for all NFT symbols:
Checking a single NFT
The following commands can be used to check the newest generated NFT:
hiveengine nftinfo nftsr
shows that the newest NFT has the ID 443.
hiveengine nft nftsr 443
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.
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 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
Leave hiveengine - improved NFT handling to:
Read more #development posts
Best Posts From Holger
We have not curated any of holger80's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Holger
- BLURT is under heavy spam attack right now
- Beempy post will create a new post, when changing the title in the yaml header, will fix this soon.
- EOS inflates their blocktivity stats by massively sending batched transactions with a value of 0.0001 EOS
- Verify blocktivity numbers for Hive and Blurt
- How to use a coldcard MK3 to derive your new account password from a 24 word seed
- Update for beem: improved account history handling
- How to use beempy in tails (e.g. for changing the account keys)
- update for beem: make beem/beempy ready for tails
- update for beem: changes regarding HF24
- update for beem: compatibility issues with HF24 have been fixed
- update for beem: automatic chain detection and several improvements/fixes
- delegationOnboardBot - a new bot for managing delegation to referred accounts created with hiveonboarding
- How to create transactions history tables with python for your tax report
- Duplicate account history entries on STEEM: How to detect and fix them
- hiveengine - improved NFT handling
- update for beem: add community support
- hiveengine - NFT support has been added
- update for beem: preperation for HF24 (eclipse)
- HIVE/STEEM API node performance of the last 30 days
- update for beem: transaction id is returned when broadcasting