{ "info": { "author": "Jonathan Lindgren", "author_email": "ejonathanlindgren@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pydero\n\nPydero is a python wrapper for interacting with smart contracts on the DERO STARGATE testnet. Installing smart contracts is currently not supported, only executing a function on an already installed smart contract on the DERO block dag or query the value of stored variables in the smart contract. Executing a function requires a running dero cli-wallet with the flag --rpc-server. Retrieving the value of a stored variable requires a derod process running. \n\n# usage\n\nFirst import the relevant classes\n```\nfrom pydero import Contract, Connection\n```\n\nInstantiate a python Contract object by the command \n\n```\ncontract = Contract(abi=abi,connection=connection,scid=scid)\n\n```\n\nconnection should be an instance of the Connection class, scid should be a string with the scid of the smart contract on the dero blockdag. abi should be a dictionary of the form corresponding to the functions and parameters of the smart contract and the parameter types should be strings that are either \"Uint64\" or \"String\". For example, if the contract has two functions called Function1 and Function2, the first with one Uint64 and one String parameter and the second with no parameters, the abi is\n\n\n```\nfrom collections import OrderedDict\nabi={\"Function1\":OrderedDict({\"ParameterName1\":\"Uint64\",\"ParameterName2\":\"String\"}),\"Function2\":{}}\n\n```\n\nThe order of function parameters is important, and therefore it is recommended to use an OrderedDict instead. Instead of specifying the abi manually, it can be loaded from the dero blockdag. This requires a valid scid and a working connection to a dero daemon.\n```\ncontract.set_abi_from_db()\n```\n\n To call a function on the contract, we simple do\n\n\n```\ncontract.Function1(123,\"abc\")\n```\n\nTo obtain the value of a stored variable called Foo:\n```\ncontract.get_attribute(\"Foo\")\n```\n\nWe can also query different information form the running wallet, for example\n```\nconnection.get_balance()\n```\n\nWe can also query the daemon for information, for example\n```\nconnection.get_last_block_header()\n```\n\n\nSee the python scripts simple_test.py and test2.py for more examples.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jonlindg/pydero", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pydero", "package_url": "https://pypi.org/project/pydero/", "platform": "", "project_url": "https://pypi.org/project/pydero/", "project_urls": { "Homepage": "https://github.com/jonlindg/pydero" }, "release_url": "https://pypi.org/project/pydero/1.0.0/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Python wrapper for interacting with the DERO blockdag", "version": "1.0.0" }, "last_serial": 5677055, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b038699aed9e36e848870c44787e82d2", "sha256": "9507f7a04a3dd859a19adf27517066916c95040ebdc89c5da80a1e755ac7f0b8" }, "downloads": -1, "filename": "pydero-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b038699aed9e36e848870c44787e82d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6940, "upload_time": "2019-08-14T13:28:51", "url": "https://files.pythonhosted.org/packages/7d/cd/8020f61763e5638578af6a1378693c63fda022cea02dca259c22ee3db196/pydero-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43e63c9025cc8b332810c4e0c0b2ed6f", "sha256": "8971ad2205484e3538aac54a8c3ef42b573c18255ef74934c6c5e9b102994633" }, "downloads": -1, "filename": "pydero-1.0.0.tar.gz", "has_sig": false, "md5_digest": "43e63c9025cc8b332810c4e0c0b2ed6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5207, "upload_time": "2019-08-14T13:28:57", "url": "https://files.pythonhosted.org/packages/be/19/0d5d832c1d6c6ba84d410637d95f4f671daf38e36930e2387dd625efbff2/pydero-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b038699aed9e36e848870c44787e82d2", "sha256": "9507f7a04a3dd859a19adf27517066916c95040ebdc89c5da80a1e755ac7f0b8" }, "downloads": -1, "filename": "pydero-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b038699aed9e36e848870c44787e82d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6940, "upload_time": "2019-08-14T13:28:51", "url": "https://files.pythonhosted.org/packages/7d/cd/8020f61763e5638578af6a1378693c63fda022cea02dca259c22ee3db196/pydero-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43e63c9025cc8b332810c4e0c0b2ed6f", "sha256": "8971ad2205484e3538aac54a8c3ef42b573c18255ef74934c6c5e9b102994633" }, "downloads": -1, "filename": "pydero-1.0.0.tar.gz", "has_sig": false, "md5_digest": "43e63c9025cc8b332810c4e0c0b2ed6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5207, "upload_time": "2019-08-14T13:28:57", "url": "https://files.pythonhosted.org/packages/be/19/0d5d832c1d6c6ba84d410637d95f4f671daf38e36930e2387dd625efbff2/pydero-1.0.0.tar.gz" } ] }