{ "info": { "author": "Hakan \u00c7elik", "author_email": "hakancelik96@outlook.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "## Getting started\n\n[Blocktrades Restler API Explorer](https://blocktrades.us/api/v2/explorer/#)\n\nInstall the package:\n\n```python\npip install blocktrades\npip install blocktrades -U\n```\n\n## How to use blocktrades\n\nAll packages can be imported as follows.\n\n```python\n>>> from blocktrades_base.http_client import HttpClient\n>>> from blocktrades_base.utils import get_active_wallets_by_type\n>>> from blocktrades.convert import *\n>>> from blocktrades.convert import __all__\n>>> from blocktrades.blocktrades import (Session, Coin, Balance,\nCitizenship, Bank, Wallet, Convert, User)\n>>> from blocktrades.operation import Op\n```\n\n#### HttpClient class\nWe can use this class to get parameters and send request from *Blocktrades API services*.\n\n```python\n>>> from blocktrades_base.http_client import HttpClient\n>>> client = HttpClient(**kwargs)\n>>> client.get(api_address:str)\n# get request\n>>> client.post(api_address:str, data:dict | default None)\n# post request\n>>> client.put(api_address:str, data:dict | default None)\n# put request\n>>> client.delete_requets(api_address:str)\n# delete request\n\n```\n\n#### get_active_wallets_by_type\nUsing this function we can see the active wallet types.\n```python\n>>> from blocktrades_base.utils import get_active_wallets_by_type\n>>> for wallet_type in get_active_wallets_by_type():\n>>> print(wallet_type)\n# btc\n# bch\n# bts\n# dash\n# doge\n# eth\n# ltc\n# xmr\n# omni\n# steem\n# sbd\n# delegated_steem_power_90_days\n\n```\n\n#### Convert class;\n\nIf you want to see all convert functions, you should write like this to see all functions, there are **132 functions**,\nyou can use all\n\n```python\n>>> from blocktrades.convert import __all__\n>>> from blocktrades.convert import *\n>>> for func in __all__:\n>>> print(func)\n```\n\nFor example;\n```python\n>>> steem_to_sp(10)\n>>> ltc_to_steem(1)\n>>> btc_to_ltc(1)\n>>> doge_to_sbd(10000)\n# run all convert function\n>>> for i in __all__:\n>>> exec(f\"print({i}(1))\")\n```\n\n\n#### Session Class\n\nI've written how to use each function in all functions,\nso you can learn how to use it by writing a code like the one below.\n\n```python\n>>> from blocktrades.blocktrades import Session\n>>> session = Session(session_token:str)\n>>> session.session\n>>> Session.session.__doc__\n# >>> session = Session(session_token:str)\n# >>> session.session\n#\n# Implementation Notes;\n# \"Get information about the specified session\"\n#\n# Model Schema;\n# {\n# \"token\": \"\",\n# \"user\": {\n# \"email\": \"\",\n# \"userId\": \"\",\n# \"timeZone\": \"\",\n# \"activated\": false,\n# \"creationTime\": \"\",\n# \"lastModifiedTime\": \"\",\n# \"lastLoginTime\": \"\"\n# },\n# \"expirationTime\": \"\"\n# }\n>>> session = Session(session_token:str)\n>>> session.invalid_method\n>>> Session.invalid_method.__doc__\n# >>> session = Session(session_token:str)\n# >>> session.invalid_method\n#\n# Implementation Notes;\n# \"Test invalid method\"\n>>> session = Session(session_token:str)\n>>> session.user_details\n>>> Session.user_details.__doc__\n# >>> session = Session(session_token:str)\n# >>> session.user_details\n#\n# Implementation Notes;\n# \"Get user details\"\n>>> session = Session(email:str, password:str)\n>>> session.create\n>>> Session.create.__doc__\n# >>> session = Session(email:str, password:str)\n# >>> session.create\n#\n# Implementation Notes;\n# \"To login as an existing user, specify a username and password.\n# To create a new unregistered session, leave the username, and password null.\"\n>>> session = Session(session_token:str, first_name:str, last_name:str, date_of_birth:str, place_of_birth:str,\n national_id_number:str, national_id_type:str)\n>>> session.create_user_details\n>>> session = Session(session_token:str, old_password:str, new_password:str, email:str)\n>>> session.update_user_credentials\n>>> session = Session(session_token:str, first_name:str, last_name:str, date_of_birth:str, place_of_birth:str,\nnational_id_number:str, national_id_type:str)\n>>> session.update_user_details\n>>> session = Session(session_token:str)\n>>> session.delete\n\n```\n\n#### Coin Class\n\n```python\n>>> from blocktrades.blocktrades import Coin\n>>> coin = Coin()\n>>> coin.coins\n>>> Coin.coins.__doc__\n# >>> coin = Coin()\n# >>> coin.coins\n# Implementation Notes;\n# \"Returns detailed info about each of the cryptocoin types supported by *BlockTrades*\"\n>>> coin = Coin(coin_type:str)\n>>> coin.coin\n>>> Coin.coin.__doc__\n# >>> coin = Coin(coin_type:str)\n# >>> coin.coin\n# Implementation Notes;\n# \"Returns detailed info about a specific coin type including users' declarations\"\n```\n\n#### Balance class\n\n```python\n>>> from blocktrades.blocktrades import Balance\n>>> balance = Balance(session_token:str)\n>>> balance.balances\n# Returns all user's affiliate balances\n>>> balance = Balance(coin_type:str, session_token:str)\n>>> balance.balance\n# Returns detailed info about a selected user's affiliate balance\n>>> balance = Balance(coin_type:str, rate_fee:str, session_token:str)\n>>> balance.set_rate_fee\n# Set the affiliate rate fee on a given coin type\n>>> balance = Balance(\n coin_type:str, amount_to_withdraw:str, receive_address:str,\n receive_memo:str, output_coin_type:str, session_token:str\n)\n>>> balance.withdraw\n# Allow an affiliate to withdraw some or all of their balance in a coin type\n```\n\n#### Citizenship class\n\n```python\n>>> from blocktrades.blocktrades import Citizenship\n>>> citizenship = Citizenship(session_token:str)\n>>> citizenship.citizenship\n# Returns info of user's citizenships\n>>> citizenship = Citizenship()\n>>> citizenship.countries\n# Returns list of all countries\n>>> citizenship = Citizenship(country_id:str, session_token:str)\n>>> citizenship.country\n# Returns info about a specific user's citizenship\n>>> citizenship = Citizenship(country_id:str, is_primary:str, session_token:str)\n>>> citizenship.create\n# Create New User's citizenship\n>>> citizenship = Citizenship(country_id:str, new_country_id:str, is_primary:str, session_token:str)\n>>> citizenship.update\n# Update Existing User's Ctizenship\n>>> citizenship = Citizenship(country_id:str, session_token:str)\n>>> citizenship.delete\n# Delete Given User's Citizenship\n```\n\n#### Bank class\n\n```python\n>>> from blocktrades.blocktrades import Bank\n>>> bank = Bank(full:bool | default True, session_token:str)\n>>> bank.banks\n# Returns list of all user's bank accounts\n>>> bank = Bank()\n>>> bank.currencies\n# Returns list of all currencies\n>>> bank = Bank(country_id:str, cy_id:str)\n>>> bank.rule\n# Returns best matching rule for showing/hiding fields of\n# Bank Account for given country and currency\n>>> bank = Bank()\n>>> bank.rules\n# Returns rules for showing/hiding fields of Bank Account depending\n# on country and currency\n>>> bank = Bank(create:bool | default True)\n>>> bank.validations\n# Returns validation information for fields of Bank Account\n>>> bank = Bank(bank_account_id:str, session_token:str)\n>>> bank.bank\n# Returns validation information for fields of Bank Account\n>>> bank = Bank(nick_name:str, currency_id:str, account_holder:str, account_number:str,\n iban:str, bank_name:str, sort_code:str, routing_number:str, swift_bic:str, ifsc_code:str, routing_code:str,\n user_address_id:str, country_id:str, zip:str, city:str, administrative_area:str, dependent_locality:str,\n sorting_code:str, organization:str, address_line1:str, address_line2:str, session_token:str )\n>>> bank.create\n# Create New User's Bank Account.\n>>> bank = Bank(nick_name:str, currency_id:str, account_holder:str, account_number:str,\n iban:str, bank_name:str, sort_code:str, routing_number:str, swift_bic:str, ifsc_code:str, routing_code:str,\n user_address_id:str, country_id:str, zip:str, city:str, administrative_area:str, dependent_locality:str,\n sorting_code:str, organization:str, address_line1:str, address_line2:str, session_token:str)\n>>> bank.update\n# Update Exisiting User's Bank Account\n>>> bank = Bank(account_id:str, session_token:str)\n>>> bank.delete\n# Delete Given User's Bank Account\n```\n\n#### Wallet class\n\n```python\n>>> from blocktrades.blocktrades import Wallet\n>>> wallet = Wallet()\n>>> wallet.active_wallets\n# This returns a list of walletTypes\n>>> wallet = Wallet()\n>>> wallet.wallets\n# Returns the list of wallets supported by *BlockTrades*\n>>> wallet = Wallet(wallet_type='steem')\n>>> wallet.wallet\n# Returns information about a single specific wallet\n>>> wallet = Wallet(wallet_type:str, address:str, request_balances:bool | default True)\n>>> wallet.wallet_validator\n# Validate whether an address is valid for a given wallet.\n```\n\n#### Convert class\n\n```python\n>>> from blocktrades.blocktrades import Convert\n>>> convert = Convert(amount:float, input_type:str, output_type:str)\n>>> convert.estimate_output_amount\n>>> convert = Convert(amount:float, input_type:str, output_type:str)\n>>> convert.estimate_input_amount\n```\n\n#### User class\n\n```python\n>>> from blocktrades.blocktrades import User\n>>> user = User(session_token:str)\n>>> user.get_user\n# You can only get user details when logged in as that user.\n# This call works for both registered and unregistered sessions.\n>>> user = User(email:str, password:str, session_token:str)\n>>> user.register_user\n# This registers a new user with the given username and password. The newly-registered\n# user is initally inactive. The user will be sent an email with a validation link to\n# verify that they own the email address. Once they click on the validation link,\n# they will be able to login.\n>>> user = User(email:str)\n>>> user.forgot_password\n# When a new user forgot password, BlockTrades sends a restoring email with a link.\n# The user clicks on to restore password.\n>>> user = User(user_id:str, restoration_id:str)\n>>> user.restore_password\n# When a user clicks link from restoring email, then user has possibility of changing password.\n>>> user = User(user_id:str, validation_id:str)\n>>> user.validate_email\n# When a new user is created, BlockTrades sends a validation email with a link.\n# The user clicks on to verify that they own the email address.\n```\n\n```\n# TODO Class Address\n# TODO Class Announcement\n# TODO Class Aeclaration\n# TODO Class Delegation\n# TODO Class InputAddress\n# TODO Class TradingPairs\n# TODO Class DepositLimit\n# TODO Class Mapping\n# TODO Class OutputAddress\n# TODO Class Transaction\n# TODO Class InitiateTrade\n# TODO Class InitiateFixedPriceRrade\n# TODO Class Transaction\n# TODO Class Crowdfund\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/hakancelik96/blocktrades", "keywords": "blocktrades", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "blocktrades", "package_url": "https://pypi.org/project/blocktrades/", "platform": "", "project_url": "https://pypi.org/project/blocktrades/", "project_urls": { "Homepage": "https://github.com/hakancelik96/blocktrades" }, "release_url": "https://pypi.org/project/blocktrades/0.0.5/", "requires_dist": null, "requires_python": "", "summary": "Python client of Blocktrades Public API", "version": "0.0.5" }, "last_serial": 4668233, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e8ae2b171b455a641c448d4b8eb02da3", "sha256": "3e61d75d94056f1e0823a6eba154e93aa12c0c128444d9ab659ab25e00599c3f" }, "downloads": -1, "filename": "blocktrades-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e8ae2b171b455a641c448d4b8eb02da3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2559, "upload_time": "2018-11-01T04:05:47", "url": "https://files.pythonhosted.org/packages/d4/54/55b1cd91d17ad3b5de0025579d55e78e0b2a5f45c4dd8497371120590b88/blocktrades-0.0.1.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "bbd848aa1e868d2b7d24f703ff310b09", "sha256": "ff6b2bdf82d83ae4a3db9c02e2d607d5e38e8aee76b4983be38a42239cda85c8" }, "downloads": -1, "filename": "blocktrades-0.0.3.tar.gz", "has_sig": false, "md5_digest": "bbd848aa1e868d2b7d24f703ff310b09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3104, "upload_time": "2018-11-02T16:07:46", "url": "https://files.pythonhosted.org/packages/7d/b6/619ee8f34c6dfd9e5eff48803bcfe81d25390a28556ecea83909a4558a95/blocktrades-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "f3f2918c96bcbc6dc55546a94f86c229", "sha256": "6baccc3d4cf2a46aa2319399a9a23d63b2840736d6f254474f6578bc8881f24f" }, "downloads": -1, "filename": "blocktrades-0.0.4.tar.gz", "has_sig": false, "md5_digest": "f3f2918c96bcbc6dc55546a94f86c229", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9243, "upload_time": "2018-11-05T23:58:24", "url": "https://files.pythonhosted.org/packages/e8/c9/120408deb7fd723e3d6d60395aeb769abc2bc66b8273bec25b0f6a0b70a7/blocktrades-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "5e4b4ac2a4ee9d9019429a9d9a2101d6", "sha256": "274779fc04647c51ba620d264c1e6e6f6e5a3c0508012616154f3932845c6940" }, "downloads": -1, "filename": "blocktrades-0.0.5.tar.gz", "has_sig": false, "md5_digest": "5e4b4ac2a4ee9d9019429a9d9a2101d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9248, "upload_time": "2019-01-07T11:14:32", "url": "https://files.pythonhosted.org/packages/b8/38/74cebc75ce6e53f511ed4fc658592152650f906c8b7a14edba0d9d73cb8d/blocktrades-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5e4b4ac2a4ee9d9019429a9d9a2101d6", "sha256": "274779fc04647c51ba620d264c1e6e6f6e5a3c0508012616154f3932845c6940" }, "downloads": -1, "filename": "blocktrades-0.0.5.tar.gz", "has_sig": false, "md5_digest": "5e4b4ac2a4ee9d9019429a9d9a2101d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9248, "upload_time": "2019-01-07T11:14:32", "url": "https://files.pythonhosted.org/packages/b8/38/74cebc75ce6e53f511ed4fc658592152650f906c8b7a14edba0d9d73cb8d/blocktrades-0.0.5.tar.gz" } ] }