pyHoneygain


NamepyHoneygain JSON
Version 0.3.9 PyPI version JSON
download
home_pagehttps://github.com/coder-amogh/pyHoneygain
SummaryUNOFFICIAL Python bindings for Honeygain Dashboard API
upload_time2024-06-16 16:41:54
maintainerNone
docs_urlNone
authorcoder-amogh (Amogh Datar)
requires_pythonNone
licenseNone
keywords python honeygain hg passive income honeygain api honeygain dashboard python honeygain
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# HoneyGain API

A Python binding to interact with HoneyGain Dashboard API.

## Installation

```BASH
pip install pyHoneygain
```

## Usage

---

### Login with username and password:

```PYTHON
from pyHoneygain import HoneyGain

# Your HoneyGain (HG) login username and password
USERNAME = ""
PASSWORD = ""

# Initialise the HoneyGain object
user = HoneyGain()

# Optionally, when instantiating you can pass in the following attributes to the HoneyGain class:
```

| Attribute      | Description        | Default Value                   |
|----------------|--------------------|---------------------------------|
| API_PREFIX_URL | The API Prefix URL | /api                            |
| API_VERSION    | The API Version    | /v1                             |
| API_DOMAIN     | The API Domain     | https://dashboard.honeygain.com |

```PYTHON
# Call the login method
user.login(USERNAME, PASSWORD)
```

---


### Create a new Honeygain account:

```PYTHON
from pyHoneygain import HoneyGain

# Your HoneyGain (HG) login username and password
EMAIL = ""
PASSWORD = ""

# Initialise the HoneyGain object
user = HoneyGain()

# Call the signup method
user.signup(EMAIL, PASSWORD)
```
Optionally you can also set the referral code
```python
REFERRAL = "REFERRAL CODE"
user.signup(EMAIL, PASSWORD, REFERRAL)
```
---

### Login with access token (JWT token):

```PYTHON
from pyHoneygain import HoneyGain

# Your HG's JWT Token
JWT_TOKEN = "eyeiufhuegjdvniu85yhjdfseu487y5urhjdfkseiwu89347yrjfdskiu8y4rjk"

# Initialise the HoneyGain object
user = HoneyGain()

# Call the login method
user.set_jwt_token(JWT_TOKEN)
```

---

### Add proxies for future requests:

```PYTHON
from pyHoneygain import HoneyGain

# With authentication
user.set_proxy("ip:port:username:password")

# Without authentication
user.set_proxy("ip:port")
```

## Functions

---

1. Get user info

    ```PYTHON
    user.me()
    ```
---

2. Get devices info

    ```PYTHON
    user.devices()
    ```

##### **Note: The /v1 and /v2 endpoint return different information as of 16th Feb 2022.**

---

3. Get stats

    ```PYTHON
    # Returns 30 days stats (earnings/credits info).
    user.stats()
    ```
---

4. Get JumpTask (JT) stats

    ```PYTHON
    # Returns 30 days JT stats (earnings/credits info).
    user.stats()
    ```
---

5. Get today's stats

    ```PYTHON
    # Returns today's earnings/credits info..
    user.stats_today()
    ```
---

6. Get today's JT stats

    ```PYTHON
    # Returns today's JT earnings/credits info..
    user.stats_today_jt()
    ```
---

7. Get notifications

    ```PYTHON
    # Returns notifications (if any)
    user.notifications()
    ```
---

8. Get payouts

    ```PYTHON
    # Returns pending payouts as per shown as dashboard
    user.payouts()
    ```

---

9. Request payout for BTC

    ```PYTHON
    # Requests payout, method as BTC to a BTC wallet address.
    BTC_ADDRESS = "bc1qr7twnwulkhd6gqwmkesvj5825kyz9mggy3mvcz"

    try:
        user.payout_to_btc(BTC_ADDRESS)
    except UserConfirmationRequiredError:
        # Sometimes HG will ask for user confirmation before accepting the payout request. 
        # So check your email and use the `add_user_confirmation` method on the user object to authenticate the user. 
        # Then you can call the payout_to_btc method again. 
        code = input("Enter the code: ")

        if user.add_user_confirmation(code):
            result = user.payout_to_btc(BTC_WALLET_ADDRESS)

            print("Withdrawal successful:", result)
    ```
---

10. Add user verification code

    ```PYTHON
    # Adds a user verification code as per the email
    code = input("Enter the verification code: ")

    user.add_user_confirmation(code) # Returns a boolean
    ```
---

11. Remove a proxy

    ```PYTHON
    # Removes a proxy for future requests.
    user.remove_proxy()
    ```
---

12. Change password

    ```PYTHON
    # Changes the password for the logged in user.
    user.change_password("oldpassword", "newpassword")
    ```
---

13. Get balances

    ```PYTHON
    # Gets balances info
    user.balances()
    ```
---

14. Open Honeypot

    ```PYTHON
    # Attempts to open Honeypot
    user.open_honeypot()
    ```
---

15. Link BSC Wallet

    ```PYTHON
    wallet_address = "0x00000000000000000000"
    user.link_bsc_wallet(wallet_address)
    ```
---

16. Verify email

    ```PYTHON
    token = "dI00qX00U006B000lK000z0000a600rt00x00000F" # Token is such kind of code sent on email
    user.confirm_email(token)
    ```
---

17. Check for a coupon code

    ```PYTHON
    from pyHoneygain import HoneyGain

    HoneyGain.coupon("freemoney") # valid (as of Apr 25, 2022)
    HoneyGain.coupon("get5") # expired (as of Apr 25, 2022)
    HoneyGain.coupon("get6") # invalid (as of Apr 25, 2022)
    ```

---

## Exceptions

- The following exceptions are defined.
    Exception | Reason
    --- | ---
    `NotLoggedInError` | Raised when you try to access protected routes (devices, payouts, etc).
    `UserConfirmationRequiredError` | Raised when you call an endpoint which requires user authentication.

- Note on `UserConfirmationRequiredError`: In case you get an error, you should check your email, add a user confirmation by using the `add_user_confirmation` method and then try to use the original method again.

---




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/coder-amogh/pyHoneygain",
    "name": "pyHoneygain",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, honeygain, hg, passive income, honeygain api, honeygain dashboard, python honeygain",
    "author": "coder-amogh (Amogh Datar)",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9b/dd/661d23ec1ad2aba935dd2be44bdf2dfe8ff4ea84287e9cce2330f156324a/pyHoneygain-0.3.9.tar.gz",
    "platform": null,
    "description": "\n# HoneyGain API\n\nA Python binding to interact with HoneyGain Dashboard API.\n\n## Installation\n\n```BASH\npip install pyHoneygain\n```\n\n## Usage\n\n---\n\n### Login with username and password:\n\n```PYTHON\nfrom pyHoneygain import HoneyGain\n\n# Your HoneyGain (HG) login username and password\nUSERNAME = \"\"\nPASSWORD = \"\"\n\n# Initialise the HoneyGain object\nuser = HoneyGain()\n\n# Optionally, when instantiating you can pass in the following attributes to the HoneyGain class:\n```\n\n| Attribute      | Description        | Default Value                   |\n|----------------|--------------------|---------------------------------|\n| API_PREFIX_URL | The API Prefix URL | /api                            |\n| API_VERSION    | The API Version    | /v1                             |\n| API_DOMAIN     | The API Domain     | https://dashboard.honeygain.com |\n\n```PYTHON\n# Call the login method\nuser.login(USERNAME, PASSWORD)\n```\n\n---\n\n\n### Create a new Honeygain account:\n\n```PYTHON\nfrom pyHoneygain import HoneyGain\n\n# Your HoneyGain (HG) login username and password\nEMAIL = \"\"\nPASSWORD = \"\"\n\n# Initialise the HoneyGain object\nuser = HoneyGain()\n\n# Call the signup method\nuser.signup(EMAIL, PASSWORD)\n```\nOptionally you can also set the referral code\n```python\nREFERRAL = \"REFERRAL CODE\"\nuser.signup(EMAIL, PASSWORD, REFERRAL)\n```\n---\n\n### Login with access token (JWT token):\n\n```PYTHON\nfrom pyHoneygain import HoneyGain\n\n# Your HG's JWT Token\nJWT_TOKEN = \"eyeiufhuegjdvniu85yhjdfseu487y5urhjdfkseiwu89347yrjfdskiu8y4rjk\"\n\n# Initialise the HoneyGain object\nuser = HoneyGain()\n\n# Call the login method\nuser.set_jwt_token(JWT_TOKEN)\n```\n\n---\n\n### Add proxies for future requests:\n\n```PYTHON\nfrom pyHoneygain import HoneyGain\n\n# With authentication\nuser.set_proxy(\"ip:port:username:password\")\n\n# Without authentication\nuser.set_proxy(\"ip:port\")\n```\n\n## Functions\n\n---\n\n1. Get user info\n\n    ```PYTHON\n    user.me()\n    ```\n---\n\n2. Get devices info\n\n    ```PYTHON\n    user.devices()\n    ```\n\n##### **Note: The /v1 and /v2 endpoint return different information as of 16th Feb 2022.**\n\n---\n\n3. Get stats\n\n    ```PYTHON\n    # Returns 30 days stats (earnings/credits info).\n    user.stats()\n    ```\n---\n\n4. Get JumpTask (JT) stats\n\n    ```PYTHON\n    # Returns 30 days JT stats (earnings/credits info).\n    user.stats()\n    ```\n---\n\n5. Get today's stats\n\n    ```PYTHON\n    # Returns today's earnings/credits info..\n    user.stats_today()\n    ```\n---\n\n6. Get today's JT stats\n\n    ```PYTHON\n    # Returns today's JT earnings/credits info..\n    user.stats_today_jt()\n    ```\n---\n\n7. Get notifications\n\n    ```PYTHON\n    # Returns notifications (if any)\n    user.notifications()\n    ```\n---\n\n8. Get payouts\n\n    ```PYTHON\n    # Returns pending payouts as per shown as dashboard\n    user.payouts()\n    ```\n\n---\n\n9. Request payout for BTC\n\n    ```PYTHON\n    # Requests payout, method as BTC to a BTC wallet address.\n    BTC_ADDRESS = \"bc1qr7twnwulkhd6gqwmkesvj5825kyz9mggy3mvcz\"\n\n    try:\n        user.payout_to_btc(BTC_ADDRESS)\n    except UserConfirmationRequiredError:\n        # Sometimes HG will ask for user confirmation before accepting the payout request. \n        # So check your email and use the `add_user_confirmation` method on the user object to authenticate the user. \n        # Then you can call the payout_to_btc method again. \n        code = input(\"Enter the code: \")\n\n        if user.add_user_confirmation(code):\n            result = user.payout_to_btc(BTC_WALLET_ADDRESS)\n\n            print(\"Withdrawal successful:\", result)\n    ```\n---\n\n10. Add user verification code\n\n    ```PYTHON\n    # Adds a user verification code as per the email\n    code = input(\"Enter the verification code: \")\n\n    user.add_user_confirmation(code) # Returns a boolean\n    ```\n---\n\n11. Remove a proxy\n\n    ```PYTHON\n    # Removes a proxy for future requests.\n    user.remove_proxy()\n    ```\n---\n\n12. Change password\n\n    ```PYTHON\n    # Changes the password for the logged in user.\n    user.change_password(\"oldpassword\", \"newpassword\")\n    ```\n---\n\n13. Get balances\n\n    ```PYTHON\n    # Gets balances info\n    user.balances()\n    ```\n---\n\n14. Open Honeypot\n\n    ```PYTHON\n    # Attempts to open Honeypot\n    user.open_honeypot()\n    ```\n---\n\n15. Link BSC Wallet\n\n    ```PYTHON\n    wallet_address = \"0x00000000000000000000\"\n    user.link_bsc_wallet(wallet_address)\n    ```\n---\n\n16. Verify email\n\n    ```PYTHON\n    token = \"dI00qX00U006B000lK000z0000a600rt00x00000F\" # Token is such kind of code sent on email\n    user.confirm_email(token)\n    ```\n---\n\n17. Check for a coupon code\n\n    ```PYTHON\n    from pyHoneygain import HoneyGain\n\n    HoneyGain.coupon(\"freemoney\") # valid (as of Apr 25, 2022)\n    HoneyGain.coupon(\"get5\") # expired (as of Apr 25, 2022)\n    HoneyGain.coupon(\"get6\") # invalid (as of Apr 25, 2022)\n    ```\n\n---\n\n## Exceptions\n\n- The following exceptions are defined.\n    Exception | Reason\n    --- | ---\n    `NotLoggedInError` | Raised when you try to access protected routes (devices, payouts, etc).\n    `UserConfirmationRequiredError` | Raised when you call an endpoint which requires user authentication.\n\n- Note on `UserConfirmationRequiredError`: In case you get an error, you should check your email, add a user confirmation by using the `add_user_confirmation` method and then try to use the original method again.\n\n---\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "UNOFFICIAL Python bindings for Honeygain Dashboard API",
    "version": "0.3.9",
    "project_urls": {
        "Bug Tracker": "https://github.com/coder-amogh/pyHoneygain/issues",
        "Homepage": "https://github.com/coder-amogh/pyHoneygain"
    },
    "split_keywords": [
        "python",
        " honeygain",
        " hg",
        " passive income",
        " honeygain api",
        " honeygain dashboard",
        " python honeygain"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23b64fd418ddb60976d586d349ba2f16abc581ccab06013307244055658c3cf7",
                "md5": "36dec2af4d6ad3695cb1eb1b4f5342b4",
                "sha256": "0d77cf8e47f4d18fea2e9fe4162ef12f26af090ddf3041709bd5cc0938224891"
            },
            "downloads": -1,
            "filename": "pyHoneygain-0.3.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "36dec2af4d6ad3695cb1eb1b4f5342b4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7750,
            "upload_time": "2024-06-16T16:41:52",
            "upload_time_iso_8601": "2024-06-16T16:41:52.348495Z",
            "url": "https://files.pythonhosted.org/packages/23/b6/4fd418ddb60976d586d349ba2f16abc581ccab06013307244055658c3cf7/pyHoneygain-0.3.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9bdd661d23ec1ad2aba935dd2be44bdf2dfe8ff4ea84287e9cce2330f156324a",
                "md5": "a7cc61c05e4f791227e245d5ecd97df6",
                "sha256": "872a8d34f16d6fdf3cb295b96aced7abeb6873af15d7eb67b30b73d94a079085"
            },
            "downloads": -1,
            "filename": "pyHoneygain-0.3.9.tar.gz",
            "has_sig": false,
            "md5_digest": "a7cc61c05e4f791227e245d5ecd97df6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6553,
            "upload_time": "2024-06-16T16:41:54",
            "upload_time_iso_8601": "2024-06-16T16:41:54.610096Z",
            "url": "https://files.pythonhosted.org/packages/9b/dd/661d23ec1ad2aba935dd2be44bdf2dfe8ff4ea84287e9cce2330f156324a/pyHoneygain-0.3.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-16 16:41:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "coder-amogh",
    "github_project": "pyHoneygain",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyhoneygain"
}
        
Elapsed time: 4.69980s