UNOFFICIAL Python bindings for Honeygain Dashboard API
Project description
HoneyGain API
A Python binding to interact with HoneyGain Dashboard API.
Installation
pip install pyHoneygain
Usage
Login with username and password:
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 |
# Call the login method
user.login(USERNAME, PASSWORD)
Login with access token (JWT token):
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:
from pyHoneygain import HoneyGain
# With authentication
user.set_proxy("ip:port:username:password")
# Without authentication
user.set_proxy("ip:port")
Functions
-
Get user info
user.me()
-
Get devices info
user.devices()
Note: The /v1 and /v2 endpoint return different information as of 16th Feb 2022.
-
Get stats
# Returns 30 days stats (earnings/credits info). user.stats()
-
Get JumpTask (JT) stats
# Returns 30 days JT stats (earnings/credits info). user.stats()
-
Get today's stats
# Returns today's earnings/credits info.. user.stats_today()
-
Get today's JT stats
# Returns today's JT earnings/credits info.. user.stats_today_jt()
-
Get notifications
# Returns notifications (if any) user.notifications()
-
Get payouts
# Returns pending payouts as per shown as dashboard user.payouts()
-
Request payout for BTC
# 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)
-
Add user verification code
# Adds a user verification code as per the email code = input("Enter the verification code: ") user.add_user_confirmation(code) # Returns a boolean
-
Remove a proxy
# Removes a proxy for future requests. user.remove_proxy()
-
Change password
# Changes the password for the logged in user. user.change_password("oldpassword", "newpassword")
-
Get balances
# Gets balances info user.balances()
-
Open Honeypot
# Attempts to open Honeypot user.open_honeypot()
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 theadd_user_confirmation
method and then try to use the original method again.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyHoneygain-0.2.3.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for pyHoneygain-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ff5b0bd21eb836657e96f0ee59fbd85000de7d6be4ba912f5b7972cbb36e413 |
|
MD5 | ca2eb1da830b20ee3fb16ce5f7332c83 |
|
BLAKE2b-256 | 900997bb8e168a04aa68e0b508ca2d06449bd6983f21b371bf4ce9d8a543c709 |