aiorocket2.tags

The API is splitted by tags. Here is the same splitting

Classes

Tags()

General class to join all tags together

class aiorocket2.tags.Tags[source]

Bases: Version, App, MultiCheque, TgInvoices, WithdrawalLink, Currencies, Health

General class to join all tags together

async check_health()

Return API Status

Return type:

Status

async create_invoice(currency, amount=None, min_payment=None, num_payments=1, description=None, hidden_message=None, comments_enabled=False, callback_url=None, payload=None, expired_in=0, platform_id=None)

Create invoice

Parameters:
  • currency (str) – Currency of transfer, info xRocketClient.get_available_currencies()

  • amount (float) – Optional. Invoice amount. 9 decimal places, others cut off. Minimum 0. Maximum 1_000_000

  • min_payment (float) – Optional. Min payment only for multi invoice if invoice amount is None. Minimum 0. Maximum 1_000_000

  • num_payments (int) – Optional. Num payments for invoice. Minimum 0. Maximum 1_000_000

  • description (str) – Optional. Description for invoice. Maximum 1000

  • hidden_message (str) – Optional. Hidden message after invoice is paid. Maximum 2000

  • comments_enabled (bool) – Optional. Allow comments. Default False

  • callback_url (str) – Optional. Url for Return button after invoice is paid. Maximum 500

  • payload (str) – Optional. Any data. Invisible to user, will be returned in callback. Maximum 4000

  • expired_in (int) – Optional. Invoice expire time in seconds, max 1 day, 0 - none expired. Minimum 0. Maximum 86400. Default 0

  • platform_id (str) – Optional. Platform identifier

Return type:

Invoice

async create_multi_cheque(currency, cheque_per_user, users_number, ref_program, password=None, description=None, send_notifications=True, enable_captcha=True, telegram_resources_ids=None, for_premium=False, linked_wallet=False, disabled_languages=None, enabled_countries=None)

Create multi-cheque

Parameters:
  • currency (str) – Currency of transfer, info xRocketClient.get_available_currencies()

  • cheque_per_user (float) – Cheque amount for one user. 9 decimal places, others cut off

  • users_number (int) – Number of users to save multicheque. 0 decimal places. Minimum 1

  • ref_program (int) – Referral program percentage (%). 0 decimal places. Minimum 0. Maximum 100

  • password (str) – Optional. Password for cheque. Max length 100

  • description (str) – Optional. Description for cheque. Max length 1000

  • send_notifications (bool) – Optional. Send notifications about activations. Default True

  • enable_captcha (bool) – Optional. Enable captcha. Default True

  • telegram_resources_ids (List of int or str) – IDs of telegram resources (groups, channels, private groups)

  • for_premium (bool) – Optional. Only users with Telegram Premium can activate this cheque. Default False

  • linked_wallet (bool) – Optional. Only users with linked wallet can activate this cheque. Default False

  • disabled_languages (List of str) – Optional. Disable languages

  • enabled_countries (List of Country) – Optional. Enabled countries

Return type:

Cheque

async create_withdrawal(network, address, currency, amount, withdrawal_id, comment)

Make withdrawal of funds to external wallet

Parameters:
  • network (Network) – Network code.

  • address (str) – Withdrawal address. E.g. EQB1cmpxb3R-YLA3HLDV01Rx6OHpMQA_7MOglhqL2CwJx_dz

  • currency (str) – Currency code

  • amount (float) – Withdrawal amount. 9 decimal places, others cut off

  • withdrawal_id (str) – Unique withdrawal ID in your system to prevent double spends. Must not be longer than 50

  • comment (str) – Withdrawal comment. Must not be longer than 50

Return type:

Withdrawal

async delete_invoice(invoice_id)

Delete invoice

Parameters:

invoice_id (int) – Invoice ID

Returns:

on success otherwise raises xRocketAPIError

Return type:

True

async delete_multi_cheque(cheque_id)

Delete multi-cheque

Parameters:

cheque_id (str) – Cheque ID

Returns:

on success, otherwise raises xRocketAPIError

Return type:

True

async edit_multi_cheque(cheque_id, password=None, description=None, send_notifications=None, enable_captcha=None, telegram_resources_ids=None, for_premium=None, linked_wallet=None, disabled_languages=None, enabled_countries=None)

Edit multi-cheque

Parameters:
  • cheque_id (int)

  • password (str) – (str): Optional. Password for cheque. Max lenght 100

  • description (str) – Optional. Description for cheque. Max lenght 1000

  • send_notifications (bool) – Optional. Send notifications about activations. Default True

  • enable_captcha (bool) – Optional. Enable captcha. Default True

  • telegram_resources_ids (List of int or str) – IDs of telegram resources (groups, channels, private groups)

  • for_premium (bool) – Optional. Only users with Telegram Premium can activate this cheque. Default False

  • linked_wallet (bool) – Optional. Only users with linked wallet can activate this cheque. Default False

  • disabled_languages (List of str) – Optional. Disable languages

  • enabled_countries (List of Country) – Optional. Enabled countries

Return type:

Cheque

async get_available_currencies()

Returns available currencies

Returns:

List of available currencies

Return type:

List[Currency]

async get_info()

Returns information about your application

Returns:

information about your application

Return type:

Info

async get_invoice(invoice_id)

Get invoice

Parameters:

invoice_id (str) – Invoice ID

Return type:

Invoice

async get_invoices(limit=100, offset=0)

Get list of invoices

Parameters:
  • limit (int) – Minimum 1. Maximum 1000. Default 100

  • offset (int) – Minimum 0. Default 0

Return type:

PaginatedInvoice

async get_multi_cheque(cheque_id)

Get multi-cheque info

Parameters:

cheque_id (str) – Cheque ID

Return type:

Cheque

async get_multi_cheques(limit=100, offset=0)

Get list of multi-cheques

Parameters:
  • limit (int) – Minimum 1. Maximum 1000. Default 100

  • offset (int) – Minimum 0. Default 0

Return type:

PaginatedCheque

async get_version()

Returns current version of API. You may use it as healthcheck

Returns:

Version string, e.g., “1.3.1”.

Return type:

str

async get_withdrawal(withdrawal_id)

Returns withdrawal info

Parameters:

withdrawal_id (str) – Unique withdrawal ID in your system.

Return type:

Withdrawal

async get_withdrawal_fees(currency=None)

Returns withdrawal fees

Parameters:

currency (str) – Coin for get fees, optional

Return type:

List[WithdrawalCoin]

Get withdrawal link

Parameters:
  • currency (str) – Currency code (xRocketClient.get_available_currencies())

  • network (Network) – Network code

  • address (str) – Target withdrawal address

  • amount (float) – Optional. Withdrawal amount. Default 0

  • comment (str) – Optional. Withdrawal comment

  • platform (str) – Optional. Platform identifier (optional, use only if provided by xRocket)

Returns:

Telegram app link

Return type:

str

async get_withdrawal_status(withdrawal_id)

Returns withdrawal status

Parameters:

withdrawal_id (str) – Unique withdrawal ID in your system.

Return type:

WithdrawalStatus

async send_transfer(tg_user_id, currency, amount, transfer_id, description=None)

Make transfer of funds to another user

Parameters:
  • tg_user_id (int) – Telegram user ID. If we dont have this user in DB, we will fail transaction with error: 400 - User not found

  • currency (str) – Currency of transfer, info xRocketClient.get_available_currencies()

  • amount (float) – Transfer amount. 9 decimal places, others cut off

  • transfer_id (str) – Unique transfer ID in your system to prevent double spends

  • description (str) – Transfer description

Return type:

Transfer