# Python SDK for xJet Connect API
## Authors
- [@xJetLabs](https://github.com/xJetLabs) (forked from)
- [@nik-1x](https://www.github.com/nik-1x)
## Installation
```shell
pip install xjet
```
If requires <b>nacl</b> package, install it <i>manually</i>:
```shell
pip install pynacl
```
## Webhook analog
```python
while True:
res = httpx.get(
'https://api.xjet.io/v1/account.events',
params={'timeout': 10},
headers={
'X-API-Key': api_key,
},
timeout=11,
)
print(res.json)
time.sleep(3)
```
## Usage/Examples
[Live example](https://replit.com/@delpydoc/xJetAPI)
### Initialization
```python
from xjet import JetAPI
# api_key: str
# private_key: str
api = JetAPI(
api_key="API_KEY",
private_key="PRIVATE_KEY",
network='mainnet' # mainnet / testnet
)
```
### Info
```python
await xjet.currencies() # Shows all saved xJetSwap currencies
```
### Account
```python
await api.me() # get API Application information.
# {'id': <str>, 'name: <str>, 'service_wallet': <str>}
await api.balance() # get balance
# {
# 'balances': [
# {'currency': <int>, 'amount': <float>,
# 'values': {'byn': 0.0, 'cny': 0.0, 'eur': 0.0, 'gbp': 0.0, 'kzt': 0.0, 'rub': 0.0, 'uah': 0.0, 'usd': 0.0}}],
# 'timestamp': <int>
# }
await api.submit_deposit() # check for deposit
# {'success': <bool>}
# ton_address: str
# currency: str
# amount: float
await api.withdraw(ton_address, currency, amount) # check for deposit
# limit: int
# offset: int
await xjet.operations(limit, offset) # operations
```
### Cheque
```python
# currency: str
# amount: float
# expires: [int, None]
# description: [str, None]
# activates_count: [int, None]
# groups_id: [int, None]
# personal_id: [int, None]
# password: [str, None]
await api.cheque_create(currency, amount, expires, description, activates_count, groups_id, personal_id, password) # create cheque
# {'cheque_id': <str>, 'external_link': 'https://t.me/xJetSwapBot?start=c_<cheque_id>'}
await api.cheque_status(cheque_id) # get cheque status
# {
# 'id': <str>,
# 'issuer_id': <str>,
# 'amount': <float>,
# 'activates_count': <int>,
# 'activates: <list[str]>,
# 'locked_value': <float>,
# 'currency': <Str>,
# 'expires': <bool>,
# 'description': <str>,
# 'status': 'activated/canceled/expired/active',
# 'password': <str | None>,
# 'groups_id': <list[str] | None>,
# 'personal_id': <int | None>,
# 'is_for_premium': <bool>
# }
await api.cheque_list() # get cheques on account
# list of cheque_status
await api.cheque_cancel(cheque_id) # delete cheque
# returns cheque_status
```
### Invoice
```python
# currency: str
# amount: float
# description: [str, None]
# max_payments: [int, None]
await api.invoice_create(currency, amount, description, max_payments) # create invoice
# {'invoice_id': <str>, 'external_link': 'https://t.me/xJetSwapBot?start=inv_<cheque_id>'}
await api.invoice_status(invoice_status) # get invoice status
# {
# 'id': <str>,
# 'description': <str>,
# 'currency': <str>,
# 'amount': <float>,
# 'max_amount': None,
# 'min_amount': None,
# 'payments': [{'telegram_id': <int>, 'amount': <float>, 'comment': [str | None}, ... ],
# 'max_payments': 1,
# 'after_pay': [],
# 'created': '2023-04-20T22:55:24.313000'
# }
await api.invoice_list() # get invoices on account
# list of invoice_status
```
```python
# NFT methods
await api.nft_list()
await api.nft_transfer(nft_address, to_address)
```
## License
[GNUv3](https://github.com/nik-1x/pyxJetAPI/blob/main/LICENSE)
Raw data
{
"_id": null,
"home_page": "https://t.me/xJetSwapBot",
"name": "xjet",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "ton,xjet,xjetswap,sdk",
"author": "delpydoc",
"author_email": "delpydoc@proton.me",
"download_url": "https://files.pythonhosted.org/packages/17/cf/1ff9e862b0ec49539c3f5e58f1f3c8fd227330d2dfca850b122d791b584f/xjet-0.1.5.tar.gz",
"platform": null,
"description": "# Python SDK for xJet Connect API\n\n## Authors\n- [@xJetLabs](https://github.com/xJetLabs) (forked from)\n- [@nik-1x](https://www.github.com/nik-1x)\n \n## Installation\n```shell\npip install xjet\n```\nIf requires <b>nacl</b> package, install it <i>manually</i>:\n```shell\npip install pynacl\n```\n\n## Webhook analog\n```python\nwhile True:\n res = httpx.get(\n 'https://api.xjet.io/v1/account.events',\n params={'timeout': 10},\n headers={\n 'X-API-Key': api_key,\n },\n timeout=11,\n )\n print(res.json)\n\n time.sleep(3)\n```\n\n\n## Usage/Examples \n[Live example](https://replit.com/@delpydoc/xJetAPI)\n\n### Initialization\n```python\nfrom xjet import JetAPI\n\n# api_key: str\n# private_key: str\napi = JetAPI(\n api_key=\"API_KEY\",\n private_key=\"PRIVATE_KEY\",\n network='mainnet' # mainnet / testnet\n)\n```\n\n\n### Info\n```python\nawait xjet.currencies() # Shows all saved xJetSwap currencies\n```\n\n\n### Account\n```python\nawait api.me() # get API Application information.\n# {'id': <str>, 'name: <str>, 'service_wallet': <str>}\n\nawait api.balance() # get balance\n# {\n# 'balances': [\n# {'currency': <int>, 'amount': <float>, \n# 'values': {'byn': 0.0, 'cny': 0.0, 'eur': 0.0, 'gbp': 0.0, 'kzt': 0.0, 'rub': 0.0, 'uah': 0.0, 'usd': 0.0}}], \n# 'timestamp': <int>\n# }\n\nawait api.submit_deposit() # check for deposit\n# {'success': <bool>}\n\n# ton_address: str\n# currency: str\n# amount: float\nawait api.withdraw(ton_address, currency, amount) # check for deposit\n\n# limit: int\n# offset: int\nawait xjet.operations(limit, offset) # operations\n```\n\n### Cheque\n```python\n# currency: str\n# amount: float\n# expires: [int, None]\n# description: [str, None]\n# activates_count: [int, None]\n# groups_id: [int, None]\n# personal_id: [int, None]\n# password: [str, None]\n\nawait api.cheque_create(currency, amount, expires, description, activates_count, groups_id, personal_id, password) # create cheque\n# {'cheque_id': <str>, 'external_link': 'https://t.me/xJetSwapBot?start=c_<cheque_id>'}\n\nawait api.cheque_status(cheque_id) # get cheque status\n# {\n# 'id': <str>, \n# 'issuer_id': <str>, \n# 'amount': <float>, \n# 'activates_count': <int>, \n# 'activates: <list[str]>, \n# 'locked_value': <float>, \n# 'currency': <Str>, \n# 'expires': <bool>, \n# 'description': <str>, \n# 'status': 'activated/canceled/expired/active', \n# 'password': <str | None>, \n# 'groups_id': <list[str] | None>, \n# 'personal_id': <int | None>, \n# 'is_for_premium': <bool>\n# }\n\n\nawait api.cheque_list() # get cheques on account\n# list of cheque_status\n\nawait api.cheque_cancel(cheque_id) # delete cheque\n# returns cheque_status\n```\n\n\n### Invoice\n```python\n# currency: str\n# amount: float\n# description: [str, None]\n# max_payments: [int, None]\nawait api.invoice_create(currency, amount, description, max_payments) # create invoice\n# {'invoice_id': <str>, 'external_link': 'https://t.me/xJetSwapBot?start=inv_<cheque_id>'}\n\nawait api.invoice_status(invoice_status) # get invoice status\n# {\n# 'id': <str>, \n# 'description': <str>, \n# 'currency': <str>, \n# 'amount': <float>, \n# 'max_amount': None, \n# 'min_amount': None, \n# 'payments': [{'telegram_id': <int>, 'amount': <float>, 'comment': [str | None}, ... ], \n# 'max_payments': 1, \n# 'after_pay': [], \n# 'created': '2023-04-20T22:55:24.313000'\n# }\n\nawait api.invoice_list() # get invoices on account\n# list of invoice_status\n```\n\n```python\n# NFT methods\nawait api.nft_list()\nawait api.nft_transfer(nft_address, to_address)\n```\n\n## License\n[GNUv3](https://github.com/nik-1x/pyxJetAPI/blob/main/LICENSE) \n",
"bugtrack_url": null,
"license": "",
"summary": "Python SDK for t.me/xJetSwapBot",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://t.me/xJetSwapBot",
"Repository": "https://github.com/xJetLabs/python-sdk"
},
"split_keywords": [
"ton",
"xjet",
"xjetswap",
"sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "15453d8d1a80ce8fa0a33917fd626ee477c3d0782fdcb2602fa2dd6806da7289",
"md5": "dca5df8d8aad95e8bca4c4fc7b4375cc",
"sha256": "6705b5a1dac7a71d3ce394cd4c80ebe1f61b9d64c5798cb09b08a5561f19d137"
},
"downloads": -1,
"filename": "xjet-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dca5df8d8aad95e8bca4c4fc7b4375cc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 18296,
"upload_time": "2023-07-27T06:22:55",
"upload_time_iso_8601": "2023-07-27T06:22:55.698313Z",
"url": "https://files.pythonhosted.org/packages/15/45/3d8d1a80ce8fa0a33917fd626ee477c3d0782fdcb2602fa2dd6806da7289/xjet-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "17cf1ff9e862b0ec49539c3f5e58f1f3c8fd227330d2dfca850b122d791b584f",
"md5": "9f581a6a012948e3d5c4775a00e352a9",
"sha256": "a768c2cac7767dff81365d1f3b9f3538fbd2dc3955ecc61d709b2b373f1a3b4e"
},
"downloads": -1,
"filename": "xjet-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "9f581a6a012948e3d5c4775a00e352a9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 18507,
"upload_time": "2023-07-27T06:22:57",
"upload_time_iso_8601": "2023-07-27T06:22:57.333884Z",
"url": "https://files.pythonhosted.org/packages/17/cf/1ff9e862b0ec49539c3f5e58f1f3c8fd227330d2dfca850b122d791b584f/xjet-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-27 06:22:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xJetLabs",
"github_project": "python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "httpx",
"specs": [
[
"==",
"0.23.3"
]
]
},
{
"name": "ecdsa",
"specs": [
[
"==",
"0.18.0"
]
]
}
],
"lcname": "xjet"
}