# Circle Chain
## build & upload
### build project
build the project please input the following command:
```shell
python3 -m build
```
### upload to testpypi
```shell
twine upload --repository testpypi dist/*
pip install -i https://test.pypi.org/simple/ circle-chain
```
after installation, test passed in the local machine. then upload the lib to the release pypi:
### upload to pypi
upload to pypi:
```shell
twine upload dist/*
```
## Install
```shell
pip install circle-chain
```
## Usage
### register and login or login with verify code
```python
# 1. first register and login or login with verify code
## option1: register and login
from circle_chain.user import send_register_verify_code,register,login,send_verify_code
response = send_register_verify_code({ "email": "<your-email>" })
if response['status'] != 200:
raise Exception(response['message'])
# receive the register verify code in your email
response = register({
"email": "<your-email>",
"passwordInput1": "111111",
"passwordInput2": "111111",
"verifyCode": "222222"
})
if response['status'] != 200:
raise Exception(response['message'])
# now login with password
response = login({
"email": "<your-email>",
"password": "111111",
})
if response['status'] != 200:
raise Exception(response['message'])
# now user login success
## option2: login with verify code
response = send_verify_code({ "email": "<your-email>" })
if response['status'] != 200:
raise Exception(response['message'])
# receive login verify code in your email
response = login({
"email": "<your-email>",
"verifyCode": "111111",
})
if response['status'] != 200:
raise Exception(response['message'])
# now user login success
## for you login, option1 and option2 are ok, you just select one.
```
### Wallet functions
```python
from circle_chain.wallet import create_wallet,list_wallet,assets_of_wallet
response = create_wallet()
if response['status'] != 200:
raise Exception(response['message'])
# get the address created
address = response['data']
response = list_wallet()
if response['status'] != 200:
raise Exception(response['message'])
# get address list
address_list = response['data']
response = assets_of_wallet()
if response['status'] != 200:
raise Exception(response['message'])
# the asset info of wallet
data = response['data']
```
### set pay password
```py
from circle_chain.user import send_pay_verify_code, set_pay_password
response = send_pay_verify_code({ "email": "<your-email>" })
if response['status'] != 200:
raise Exception(response['message'])
# receive the pay verify code in your email
response = set_pay_password({
"account": {
"email": "test@gmail.com"
},
"password": "333333",
"verifyCode": "112222"
})
if response['status'] != 200:
raise Exception(response['message'])
# now your pay password is set success
```
### Transactions
```py
from circle_chain.wallet import send_to, pay
from_address = '1L8eRrBuWnBxcQ6DKCDkkPM7ozxDcmpho1'
to = '14hF1BynFVnBEFKxyo51FHmJksVwfxg4sg'
# send asset from `1L8eRrBuWnBxcQ6DKCDkkPM7ozxDcmpho1` to `14hF1BynFVnBEFKxyo51FHmJksVwfxg4sg`
response = send_to({
'email': 'test@gmail.com',
'from': from_address,
'address': to,
'transContent': {
'type': 1,
'uuid': 'e1f1d3c7-3c6e-4f3b-a50d-58710b851357'
},
'payPassword': '111111'
})
if response['status'] != 200:
raise Exception(response['message'])
# asset is sent success
# pay balance from `1L8eRrBuWnBxcQ6DKCDkkPM7ozxDcmpho1` to `14hF1BynFVnBEFKxyo51FHmJksVwfxg4sg`
response = pay({
'from': from_address,
'to': to,
'value': 100,
'payPassword': "111111"
});
if response['status'] != 200:
raise Exception(response['message'])
# the value is paid success.
```
### add contacts
```py
from circle_chain.user import add_contacts
response = add_contacts({
'email': "test2@gmail.com",
'name': "test2",
'sex': 1,
'address': "beijing"
});
if response['status'] != 200:
raise Exception(response['message'])
# the contact is added success.
```
## APIs
### circle_node
1. `subcribe`
2. `server_features`
3. `broadcast_transaction`
### circle_user
1. `send_verify_code`
2. `login`
3. `logout`
4. `send_register_verify_code`
5. `register`
6. `add_contacts`
7. `list_contacts`
8. `send_pay_verify_code`
9. `set_pay_password`
10. `have_pay_password`
11. `send_reset_password_verify_code`
12. `reset_password`
13. `save_or_update_user_info`
14. `user_info`
### circle_wallet
#### cloud wallets
1. `create_wallet`
2. `list_wallet`
3. `balance_of_wallet`
4. `assets_of_wallet`
5. `assets_of_address`
6. `get_public_key_hash_from_address`
7. `balance_of_address`
8. `send_to`
9. `pay`
10. `search_tx_by_type`
11. `search_tx_by_time`
12. `public_key_from_address`
13. `let_me_try`
#### open wallets
1. `public_get_address_by_uid`
2. `public_get_assets_of_address`
3. `public_search_transaction`
4. `public_get_balance_of_address`
### circle_block
1. `get_block_hash_list`
2. `get_block`
3. `get_block_header_list`
4. `get_block_data`
5. `get_block_tail_hash_list`
6. `get_block_tails_po`
7. `get_transaction_by_txid`
8. `search_tx_by_txid`
9. `search_tx_by_address`
10. `search_utxo`
Raw data
{
"_id": null,
"home_page": null,
"name": "circle-chain",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "circle chain, block, wallet, bitcoin",
"author": null,
"author_email": "lidh04 <lidh04@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e4/86/162a1e347d9ee4237cbe51f18d8619fde309ba1fb9d52b6863131b357112/circle_chain-0.0.4.tar.gz",
"platform": null,
"description": "# Circle Chain \n## build & upload\n\n### build project\n\nbuild the project please input the following command:\n\n```shell\npython3 -m build\n```\n\n### upload to testpypi\n\n```shell\ntwine upload --repository testpypi dist/*\npip install -i https://test.pypi.org/simple/ circle-chain\n```\nafter installation, test passed in the local machine. then upload the lib to the release pypi:\n\n### upload to pypi\n\nupload to pypi:\n\n```shell\ntwine upload dist/*\n```\n\n## Install\n\n```shell\npip install circle-chain\n```\n\n## Usage\n\n### register and login or login with verify code\n\n```python\n# 1. first register and login or login with verify code\n## option1: register and login\nfrom circle_chain.user import send_register_verify_code,register,login,send_verify_code\nresponse = send_register_verify_code({ \"email\": \"<your-email>\" })\nif response['status'] != 200:\n raise Exception(response['message'])\n# receive the register verify code in your email\nresponse = register({\n \"email\": \"<your-email>\",\n \"passwordInput1\": \"111111\",\n \"passwordInput2\": \"111111\",\n \"verifyCode\": \"222222\"\n})\nif response['status'] != 200:\n raise Exception(response['message'])\n \n# now login with password\nresponse = login({\n \"email\": \"<your-email>\",\n \"password\": \"111111\",\n})\nif response['status'] != 200:\n raise Exception(response['message'])\n# now user login success\n## option2: login with verify code\nresponse = send_verify_code({ \"email\": \"<your-email>\" })\nif response['status'] != 200:\n raise Exception(response['message'])\n# receive login verify code in your email\nresponse = login({\n \"email\": \"<your-email>\",\n \"verifyCode\": \"111111\",\n})\nif response['status'] != 200:\n raise Exception(response['message'])\n# now user login success\n## for you login, option1 and option2 are ok, you just select one.\n```\n\n### Wallet functions\n\n```python\nfrom circle_chain.wallet import create_wallet,list_wallet,assets_of_wallet\nresponse = create_wallet()\nif response['status'] != 200:\n raise Exception(response['message'])\n# get the address created\naddress = response['data']\nresponse = list_wallet()\nif response['status'] != 200:\n raise Exception(response['message'])\n# get address list\naddress_list = response['data']\nresponse = assets_of_wallet()\nif response['status'] != 200:\n raise Exception(response['message'])\n# the asset info of wallet\ndata = response['data']\n```\n\n### set pay password\n\n```py\nfrom circle_chain.user import send_pay_verify_code, set_pay_password\nresponse = send_pay_verify_code({ \"email\": \"<your-email>\" })\nif response['status'] != 200:\n raise Exception(response['message'])\n# receive the pay verify code in your email\nresponse = set_pay_password({\n \"account\": {\n \"email\": \"test@gmail.com\"\n },\n \"password\": \"333333\",\n \"verifyCode\": \"112222\"\n})\nif response['status'] != 200:\n raise Exception(response['message'])\n# now your pay password is set success\n```\n\n### Transactions\n\n```py\nfrom circle_chain.wallet import send_to, pay\nfrom_address = '1L8eRrBuWnBxcQ6DKCDkkPM7ozxDcmpho1'\nto = '14hF1BynFVnBEFKxyo51FHmJksVwfxg4sg'\n# send asset from `1L8eRrBuWnBxcQ6DKCDkkPM7ozxDcmpho1` to `14hF1BynFVnBEFKxyo51FHmJksVwfxg4sg`\nresponse = send_to({\n 'email': 'test@gmail.com',\n 'from': from_address,\n 'address': to,\n 'transContent': {\n 'type': 1,\n 'uuid': 'e1f1d3c7-3c6e-4f3b-a50d-58710b851357'\n },\n 'payPassword': '111111'\n})\nif response['status'] != 200:\n raise Exception(response['message'])\n# asset is sent success\n\n# pay balance from `1L8eRrBuWnBxcQ6DKCDkkPM7ozxDcmpho1` to `14hF1BynFVnBEFKxyo51FHmJksVwfxg4sg`\nresponse = pay({\n 'from': from_address,\n 'to': to,\n 'value': 100,\n 'payPassword': \"111111\"\n});\nif response['status'] != 200:\n raise Exception(response['message'])\n# the value is paid success.\n```\n\n### add contacts\n\n```py\nfrom circle_chain.user import add_contacts\nresponse = add_contacts({\n 'email': \"test2@gmail.com\",\n 'name': \"test2\",\n 'sex': 1,\n 'address': \"beijing\"\n});\nif response['status'] != 200:\n raise Exception(response['message'])\n# the contact is added success.\n```\n\n## APIs\n\n### circle_node\n\n1. `subcribe`\n\n2. `server_features`\n\n3. `broadcast_transaction`\n\n### circle_user\n\n1. `send_verify_code`\n2. `login`\n3. `logout`\n4. `send_register_verify_code`\n5. `register`\n6. `add_contacts`\n7. `list_contacts`\n8. `send_pay_verify_code`\n9. `set_pay_password`\n10. `have_pay_password`\n11. `send_reset_password_verify_code`\n12. `reset_password`\n13. `save_or_update_user_info`\n14. `user_info`\n\n### circle_wallet\n\n#### cloud wallets\n\n1. `create_wallet`\n2. `list_wallet`\n3. `balance_of_wallet`\n4. `assets_of_wallet`\n5. `assets_of_address`\n6. `get_public_key_hash_from_address`\n7. `balance_of_address`\n8. `send_to`\n9. `pay`\n10. `search_tx_by_type`\n11. `search_tx_by_time`\n12. `public_key_from_address`\n13. `let_me_try`\n\n#### open wallets\n\n1. `public_get_address_by_uid`\n2. `public_get_assets_of_address`\n3. `public_search_transaction`\n4. `public_get_balance_of_address`\n\n### circle_block\n\n1. `get_block_hash_list`\n2. `get_block`\n3. `get_block_header_list`\n4. `get_block_data`\n5. `get_block_tail_hash_list`\n6. `get_block_tails_po`\n7. `get_transaction_by_txid`\n8. `search_tx_by_txid`\n9. `search_tx_by_address`\n10. `search_utxo`\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "circle chain sdk in python",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://gitee.com/lidh04/python-circle-chain",
"Issues": "https://gitee.com/lidh04/python-circle-chain/issues"
},
"split_keywords": [
"circle chain",
" block",
" wallet",
" bitcoin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5bb10b1f729c9fb1626e6d93a72da34aa53b1543231ffd354cce06cb05c5b589",
"md5": "e61dcba6b64020d3183d75b901fa95cd",
"sha256": "4b7cd0fc6bce91d273b4b9ad59692270cfc988fbdb20a5578e966fa84649ea26"
},
"downloads": -1,
"filename": "circle_chain-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e61dcba6b64020d3183d75b901fa95cd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11376,
"upload_time": "2024-09-17T03:21:20",
"upload_time_iso_8601": "2024-09-17T03:21:20.643260Z",
"url": "https://files.pythonhosted.org/packages/5b/b1/0b1f729c9fb1626e6d93a72da34aa53b1543231ffd354cce06cb05c5b589/circle_chain-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e486162a1e347d9ee4237cbe51f18d8619fde309ba1fb9d52b6863131b357112",
"md5": "7c672438651c4c6aba9d10b2e4ccaedd",
"sha256": "fb3272e7eeed4dc929154978a90e6003d6d648531e2bc49137342dc45e6904db"
},
"downloads": -1,
"filename": "circle_chain-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "7c672438651c4c6aba9d10b2e4ccaedd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 13033,
"upload_time": "2024-09-17T03:21:22",
"upload_time_iso_8601": "2024-09-17T03:21:22.524686Z",
"url": "https://files.pythonhosted.org/packages/e4/86/162a1e347d9ee4237cbe51f18d8619fde309ba1fb9d52b6863131b357112/circle_chain-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-17 03:21:22",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "circle-chain"
}