Skip to main content

command line tool and python library for sending hive engine tokens

Project description

nectarengine

Python tools for obtaining and processing hive engine tokens

Latest Version

Python Versions

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nectarengine-0.1.0.tar.gz (75.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nectarengine-0.1.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file nectarengine-0.1.0.tar.gz.

File metadata

  • Download URL: nectarengine-0.1.0.tar.gz
  • Upload date:
  • Size: 75.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for nectarengine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd6126fc99cbc8ad61da00f899c6e9922bdcefd38d4da7fce4646573cbf70c52
MD5 21229bb1bb27bb9652500cfd63aab912
BLAKE2b-256 072aaba1130633e56c326c0884cd5907ba79ed5a555a7f487fdc412691a14e9a

See more details on using hashes here.

File details

Details for the file nectarengine-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nectarengine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c55d78b8a7a591ccbe495f3f2d26d5d4a35fad7b9a47fd2d7c921464019e430
MD5 5caa625c14341ad2e9c7d0a7224b3f42
BLAKE2b-256 d338ed20f5ef9d75aaa2f249b2a59fb63fc51214b37466bfb404fcb99dced9e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page