command line tool and python library for sending hive engine tokens
Project description
nectarengine
Python tools for obtaining and processing hive engine tokens
Installation
pip install nectarengine
Commands
Get the latest block of the sidechain
from nectarengine.api import Api
api = Api()
print(api.get_latest_block_info())
Get the block with the specified block number of the sidechain
from nectarengine.api import Api
api = Api()
print(api.get_block_info(1910))
Retrieve the specified transaction info of the sidechain
from nectarengine.api import Api
api = Api()
print(api.get_transaction_info("e6c7f351b3743d1ed3d66eb9c6f2c102020aaa5d"))
Get the contract specified from the database
from nectarengine.api import Api
api = Api()
print(api.get_contract("tokens"))
Get an array of objects that match the query from the table of the specified contract
from nectarengine.api import Api
api = Api()
print(api.find("tokens", "tokens"))
Get the object that matches the query from the table of the specified contract
from nectarengine.api import Api
api = Api()
print(api.find_one("tokens", "tokens"))
Get the transaction history for an account and a token
from nectarengine.api import Api
api = Api()
print(api.get_history("thecrazygm", "INCOME"))
Token transfer
from nectar import Hive
from nectarengine.wallet import Wallet
hv = Hive(keys=["5xx"])
wallet = Wallet("test_user", blockchain_instance=hv)
wallet.transfer("test1",1,"TST", memo="This is a test")
Buy/Sell
Create a buy order
from nectar import Hive
from nectarengine.market import Market
hv = Hive(keys=["5xx"])
m=Market(blockchain_instance=hv)
m.buy("test_user", 1, "TST", 9.99)
Create a sell order
from nectar import Hive
from nectarengine.market import Market
hv = Hive(keys=["5xx"])
m=Market(blockchain_instance=hv)
m.sell("test_user", 1, "TST", 9.99)
Cancel a buy order
from nectar import Hive
from nectarengine.market import Market
hv = Hive(keys=["5xx"])
m=Market(blockchain_instance=hv)
open_buy_orders = m.get_buy_book("TST", "test_user")
m.cancel("test_user", "buy", open_buy_orders[0]["_id"])
Cancel a sell order
from nectar import Hive
from nectarengine.market import Market
hv = Hive(keys=["5xx"])
m=Market(blockchain_instance=hv)
open_sell_orders = m.get_sell_book("TST", "test_user")
m.cancel("test_user", "sell", open_sell_orders[0]["_id"])
Deposit Hive
from nectar import Hive
from nectarengine.market import Market
hv = Hive(keys=["5xx"])
m=Market(blockchain_instance=hv)
m.deposit("test_user", 10)
Withdrawal
from nectar import Hive
from nectarengine.market import Market
hv = Hive(keys=["5xx"])
m=Market(blockchain_instance=hv)
m.withdraw("test_user", 10)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nectarengine-0.2.1.tar.gz.
File metadata
- Download URL: nectarengine-0.2.1.tar.gz
- Upload date:
- Size: 108.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f7bc838089937580b052e6ed8461ab82c8734c358c8a25ff21ac8a9d44dc6ce
|
|
| MD5 |
25243d2d871198a6a1de5ffb65ba2090
|
|
| BLAKE2b-256 |
6eeb643715fd2362da6383cbe98423f3972f8b1244cd0e47ae00ef157e08e56e
|
File details
Details for the file nectarengine-0.2.1-py3-none-any.whl.
File metadata
- Download URL: nectarengine-0.2.1-py3-none-any.whl
- Upload date:
- Size: 40.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91dd65a0099d1549e1ff804f10976f809807c9eae7b1eebb05f6aadad6271d33
|
|
| MD5 |
0fa039a817905470533a12a3ab422258
|
|
| BLAKE2b-256 |
b193cc0e9a0f9f8f78941ddd6ac1b819768ceb5e1a86169649eff4bcd2ac632a
|