{ "info": { "author": "Han Xiao", "author_email": "smallcpp@foxmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python :: 3.6" ], "description": "- [Contract](#contract)\n - [`get_events(start_block_num, to_block_num, event_id)`](#get_eventsstart_block_num-to_block_num-event_id)\n- [FunctionCoder](#functioncoder)\n - [`encode_function(function_name, *args)`](#encode_functionfunction_name-args)\n - [`decode_result(self, function_name, data)`](#decode_resultself-function_name-data)\n- [EventDecoder](#eventdecoder)\n - [`decode_event(log)`](#decode_eventlog)\n\n# Contract\n\n```py\nfrom vecha import Contract\n\ncontract = Contract(endpoint, address, abi_list)\n```\n\n**Parameters**:\n\n- **endpoint**: `str`, thor restful server\n- **address**: `str`, contract address\n- **abi_list**: `List[Dict]`, contract abi\n\nThen you can call the function directly on the contract instance via the function name in abi.\n\nThe `get_events` function names are built in, so the same name function in the smart contract will not be called.\n\nIn a smart contract, the function can be a call or a transaction. A transaction must provide private key.\n\n```py\ncontract.you_name(*args, caller=None, value=0) # a call\n\ncontract.you_name(*args, pk, value) # a transaction\n```\n\nYou can display the transaction as a call, this may help you debug smart contract.\n\n```py\ncontract.you_name.call(*args, caller=None, value=0)\n```\n\n## `get_events(start_block_num, to_block_num, event_id)`\n\n**Parameters**:\n\n- **start_block_num** (optional): `int`, default is from genesis block\n- **to_block_num** (optional): `int`, default is to best block\n- **event_id** (optional): `str`, the signature of the event you want to filter out, default is all events of this contract\n\n**Returns**:\n\n- `List[Event]`, A list of Events. Event is a `namedtuple`, and it has three fields:\n - event.name: `str`\n - event.args: `Dict`, actual parameters when the event is emited\n - event.block: `int`, the block number when the event is emited\n\n> If you want to parse a log directly, please use [`EventDecoder.decode_event`](#decode_eventlog).
\n> If you want to get an unsigned transaction data, you can use [`FunctionCoder.encode_function`](#encode_functionfunction_name-args).\n\n# FunctionCoder\n\n```py\nfrom vecha import FunctionCoder\n\nfn_coder = FunctionCoder(*fn_abi_list)\n```\n\n## `encode_function(function_name, *args)`\n\n**Parameters**:\n\n- **function_name**: `str`\n- **args**: variable-length argument list of actual parameters\n\n**Returns**:\n\n- `str`, the data of a transaction that has not been signed\n\n## `decode_result(self, function_name, data)`\n\n\n# EventDecoder\n\n```py\nfrom vecha import EventDecoder\n\nev_decoder = EventDecoder(*event_abi_list)\n```\n\n## `decode_event(log)`\n\n**Parameters**:\n\n- **log**: `Dict`, the result of thor restful api `/logs/event`\n\n**Returns**:\n\n- `Event`, Event is a `namedtuple`, and it has three fields:\n - event.name: `str`\n - event.args: `Dict`, actual parameters when the event is emited\n - event.block: `int`, the block number when the event is emited\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/uldaman/vecha.py", "keywords": "thor blockchain ethereum", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "vecha", "package_url": "https://pypi.org/project/vecha/", "platform": "", "project_url": "https://pypi.org/project/vecha/", "project_urls": { "Homepage": "https://github.com/uldaman/vecha.py" }, "release_url": "https://pypi.org/project/vecha/0.0.1/", "requires_dist": [ "eth-keys (==0.2.1)", "json-rpc (==1.12.1)", "lru-dict (==1.1.6)", "requests (==2.21.0)", "rlp (==0.6.0)" ], "requires_python": ">=3.6", "summary": "Python library to aid DApp-Server development on VeChain Thor.", "version": "0.0.1" }, "last_serial": 5082166, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "ce27b3150753bd2d9f99b833ad5b5cc1", "sha256": "dec1c1320295b0bb722ccb41e918fe5693a05534ae95db437a7a84beeaf51d30" }, "downloads": -1, "filename": "vecha-0.0.0-py36-none-any.whl", "has_sig": false, "md5_digest": "ce27b3150753bd2d9f99b833ad5b5cc1", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 17991, "upload_time": "2019-03-29T09:24:17", "url": "https://files.pythonhosted.org/packages/14/56/d187441076dd240ae7c0c2e8ad734b8a855dc000fb4f9d0dd0d7d851fa95/vecha-0.0.0-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c26b5316b410d20bd3098688ba9a0a4", "sha256": "523c8bee836deacfdd9a848e6e15e6f7592a919b2add336177fa8917c8dfbc1b" }, "downloads": -1, "filename": "vecha-0.0.0.tar.gz", "has_sig": false, "md5_digest": "3c26b5316b410d20bd3098688ba9a0a4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15563, "upload_time": "2019-03-29T09:24:20", "url": "https://files.pythonhosted.org/packages/8a/c9/0273d62f0513bd94a090a0288f4a9b5bdd78db7e438545982a03099fd2b8/vecha-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "b5c759571aedf7e630c5575449c5cb84", "sha256": "8bd2db8eb9023de976dff7f71a66977c59492f0bd09ef64bd573063746e12f61" }, "downloads": -1, "filename": "vecha-0.0.1-py36-none-any.whl", "has_sig": false, "md5_digest": "b5c759571aedf7e630c5575449c5cb84", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 17894, "upload_time": "2019-04-03T04:28:25", "url": "https://files.pythonhosted.org/packages/02/39/88923a4f159156fd59152fe5595e519116b7809cc4c4ba3a908f55aca897/vecha-0.0.1-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "58076dd3ea38885db5d0e478e5ac8b03", "sha256": "5afc2cebe03096136942f7599153d014163d1c3b84ba37e73b216f0bcffd7a1a" }, "downloads": -1, "filename": "vecha-0.0.1.tar.gz", "has_sig": false, "md5_digest": "58076dd3ea38885db5d0e478e5ac8b03", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15399, "upload_time": "2019-04-03T04:28:27", "url": "https://files.pythonhosted.org/packages/f5/63/23131b3ac31bc2c1c53cae6202568f5d0dc6767793270cdfd047ee39d8c6/vecha-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b5c759571aedf7e630c5575449c5cb84", "sha256": "8bd2db8eb9023de976dff7f71a66977c59492f0bd09ef64bd573063746e12f61" }, "downloads": -1, "filename": "vecha-0.0.1-py36-none-any.whl", "has_sig": false, "md5_digest": "b5c759571aedf7e630c5575449c5cb84", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", "size": 17894, "upload_time": "2019-04-03T04:28:25", "url": "https://files.pythonhosted.org/packages/02/39/88923a4f159156fd59152fe5595e519116b7809cc4c4ba3a908f55aca897/vecha-0.0.1-py36-none-any.whl" }, { "comment_text": "", "digests": { "md5": "58076dd3ea38885db5d0e478e5ac8b03", "sha256": "5afc2cebe03096136942f7599153d014163d1c3b84ba37e73b216f0bcffd7a1a" }, "downloads": -1, "filename": "vecha-0.0.1.tar.gz", "has_sig": false, "md5_digest": "58076dd3ea38885db5d0e478e5ac8b03", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15399, "upload_time": "2019-04-03T04:28:27", "url": "https://files.pythonhosted.org/packages/f5/63/23131b3ac31bc2c1c53cae6202568f5d0dc6767793270cdfd047ee39d8c6/vecha-0.0.1.tar.gz" } ] }