aiorocket2.models¶
Modules (dataclases) used by aiorocket2
Functions
|
Recursively converts an object to a dictionary suitable for JSON serialization. |
Classes
|
Represents a balance entity returned by the xRocket Pay API. |
|
Base class for all models |
|
Represents a multi-cheque entity returned by the xRocket Pay API. |
|
Represents a Currency entity returned by the xRocket Pay API. |
|
Time object, to comfortable get time from the api |
|
Represents a info entity returned by the xRocket Pay API. |
|
Represents a Invoice entity returned by the xRocket Pay API. |
|
Represents a PaginatedCheque entity returned by the xRocket Pay API. |
|
Represents a PaginatedInvoice entity returned by the xRocket Pay API. |
|
Represents a TgResourse entity returned by the xRocket Pay API. |
|
Represents a transfer entity returned by the xRocket Pay API. |
|
Represents a Withdrawal entity returned by the xRocket Pay API. |
|
Represents a WithdrawalCoin entity returned by the xRocket Pay API. |
|
Represents a WithdrawalCoinFees entity returned by the xRocket Pay API. |
|
Represents a WithdrawalFee entity returned by the xRocket Pay API. |
- class aiorocket2.models.Balance(currency, balance)[source]¶
Bases:
BaseRepresents a balance entity returned by the xRocket Pay API.
- Parameters:
currency (str)
balance (float)
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- balance: float¶
- currency: str¶
- class aiorocket2.models.Cheque(id, currency, total, per_user, users, password, description, send_notifications, ref_program_percents, ref_reward_per_user, captcha_enabled, state, link, disabled_languages, enabled_countries, for_premium, for_new_users_only, linked_wallet, tg_resources, activations, ref_rewards)[source]¶
Bases:
BaseRepresents a multi-cheque entity returned by the xRocket Pay API.
- Parameters:
id (int)
currency (str)
total (int)
per_user (int)
users (int)
password (str)
description (str)
send_notifications (bool)
ref_program_percents (int)
ref_reward_per_user (float)
captcha_enabled (bool)
state (ChequeState)
link (str)
disabled_languages (List[str])
enabled_countries (List[Country])
for_premium (bool)
for_new_users_only (bool)
linked_wallet (bool)
tg_resources (List[TgResource])
activations (int)
ref_rewards (int)
- activations: int¶
How many times cheque is activate
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- captcha_enabled: bool¶
enable / disable cheque captcha
- currency: str¶
- description: str¶
Cheque description
- disabled_languages: List[str]¶
Disable languages
- for_new_users_only: bool¶
Only new users can activate this cheque
Only users with Telegram Premium can activate this cheque
- classmethod from_api(j)[source]¶
Build Cheque from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- id: int¶
Cheque ID
- link: str¶
- linked_wallet: bool¶
Only users with connected wallets can activate this cheque
- password: str¶
Cheque password
- per_user: int¶
Amount of cheque per user
- ref_program_percents: int¶
percentage of cheque that rewarded for referral program
- ref_reward_per_user: float¶
amount of referral user reward
- ref_rewards: int¶
How many times referral reward is payed
- send_notifications: bool¶
send notifications about cheque activation to application cheque webhook or not
- state: ChequeState¶
- tg_resources: List[TgResource]¶
- total: int¶
Total amount of cheque (this amount is charged from balance)
- users: int¶
Number of users that can activate your cheque
- class aiorocket2.models.Currency(currency, name, min_transfer, min_cheque, min_invoice, min_withdraw, withdraw_fee)[source]¶
Bases:
BaseRepresents a Currency entity returned by the xRocket Pay API.
- Parameters:
currency (str)
name (str)
min_transfer (float)
min_cheque (float)
min_invoice (float)
min_withdraw (float)
withdraw_fee (WithdrawalFee)
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- currency: str¶
ID of currency, use in Rocket Pay Api
- classmethod from_api(j)[source]¶
Build Currency from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- min_cheque: float¶
Minimal amount for cheque
- min_invoice: float¶
Minimal amount for invoice
- min_transfer: float¶
Minimal amount for transfer
- min_withdraw: float¶
Minimal amount for withdrawals
- name: str¶
Name of currency
- withdraw_fee: WithdrawalFee¶
- class aiorocket2.models.Info(name, fee_percents, balances)[source]¶
Bases:
BaseRepresents a info entity returned by the xRocket Pay API.
- Parameters:
name (str)
fee_percents (float)
balances (List[Balance])
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- fee_percents: float¶
Fee for incoming transactions
- classmethod from_api(j)[source]¶
Build Info from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- name: str¶
Name of current app
- class aiorocket2.models.Invoice(id, amount, min_payment, total_activations, activations_left, description, hidden_message, payload, callback_url, comments_enabled, currency, created, paid, status, expired_in, link)[source]¶
Bases:
BaseRepresents a Invoice entity returned by the xRocket Pay API.
- Parameters:
id (int)
amount (float)
min_payment (float)
total_activations (int)
activations_left (int)
description (str)
hidden_message (str)
payload (str)
callback_url (str)
comments_enabled (bool)
currency (str)
created (DateTimeStr)
paid (DateTimeStr)
status (InvoiceStatus)
expired_in (int)
link (str)
- activations_left: int¶
Activations left of invoice
- amount: float¶
Amount of invoice
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- callback_url: str¶
url that will be set for Return button after invoice is paid
- comments_enabled: bool¶
Allow comments for invoice
- created: DateTimeStr¶
(date-time) When invoice was created
- currency: str¶
- description: str¶
Invoice description
- expired_in: int¶
Invoice expire time in seconds, max 1 day, 0 - none expired
- classmethod from_api(j)[source]¶
Build Invoice from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
Message that will be displayed after invoice payment
- id: int¶
Invoice ID
- link: str¶
- min_payment: float¶
Min payment of invoice
- paid: DateTimeStr¶
(date-time) When invoice was paid
- payload: str¶
Any data that is attached to invoice
- status: InvoiceStatus¶
- total_activations: int¶
Total activations of invoice
- class aiorocket2.models.PaginatedCheque(total, limit, offset, results)[source]¶
Bases:
BaseRepresents a PaginatedCheque entity returned by the xRocket Pay API.
- Parameters:
total (int)
limit (int)
offset (int)
results (List[Cheque])
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- classmethod from_api(j)[source]¶
Build PaginatedCheque from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- limit: int¶
- offset: int¶
- total: int¶
Total times
- class aiorocket2.models.PaginatedInvoice(total, limit, offset, results)[source]¶
Bases:
BaseRepresents a PaginatedInvoice entity returned by the xRocket Pay API.
- Parameters:
total (int)
limit (int)
offset (int)
results (List[Invoice])
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- classmethod from_api(j)[source]¶
Build PaginatedInvoice from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- limit: int¶
- offset: int¶
- total: int¶
Total times
- class aiorocket2.models.TgResource(telegram_id, name, username)[source]¶
Bases:
BaseRepresents a TgResourse entity returned by the xRocket Pay API.
- Parameters:
telegram_id (int)
name (str)
username (str)
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- classmethod from_api(j)[source]¶
Build Cheque from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- name: str¶
- telegram_id: int¶
- username: str¶
- class aiorocket2.models.Transfer(id, tg_user_id, currency, amount, description)[source]¶
Bases:
BaseRepresents a transfer entity returned by the xRocket Pay API.
- Parameters:
id (int)
tg_user_id (int)
currency (str)
amount (float)
description (str)
- amount: float¶
Transfer amount. 9 decimal places, others cut off
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- currency: str¶
Currency code
- description: str¶
Transfer description
- classmethod from_api(j)[source]¶
Build Transfer from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- id: int¶
Transfer ID
- tg_user_id: int¶
- class aiorocket2.models.Withdrawal(network, address, currency, amount, withdrawal_id, status, comment, tx_hash, tx_link)[source]¶
Bases:
BaseRepresents a Withdrawal entity returned by the xRocket Pay API.
- Parameters:
network (Network)
address (str)
currency (str)
amount (float)
withdrawal_id (str)
status (WithdrawalStatus)
comment (str)
tx_hash (str)
tx_link (str)
- address: str¶
Withdrawal address
- amount: float¶
Withdrawal amount. 9 decimal places, others cut off
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- comment: str¶
Withdrawal comment
- currency: str¶
Currency code
- classmethod from_api(j)[source]¶
Build Withdrawal from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- status: WithdrawalStatus¶
Withdrawal status
- tx_hash: str¶
Withdrawal TX hash. Provided only after withdrawal.
- tx_link: str¶
Withdrawal TX link. Provided only after withdrawal
- withdrawal_id: str¶
Unique withdrawal ID in your system to prevent double spends
- class aiorocket2.models.WithdrawalCoin(code, min_withdrawal, fees)[source]¶
Bases:
BaseRepresents a WithdrawalCoin entity returned by the xRocket Pay API.
- Parameters:
code (str)
min_withdrawal (float)
fees (List[WithdrawalCoinFees])
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- code: str¶
Crypto code
- fees: List[WithdrawalCoinFees]¶
- classmethod from_api(j)[source]¶
Build WithdrawalCoin from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- min_withdrawal: float¶
Minimal amount for withdrawals
- class aiorocket2.models.WithdrawalCoinFees(network_code, fee, currency)[source]¶
Bases:
BaseRepresents a WithdrawalCoinFees entity returned by the xRocket Pay API.
- Parameters:
network_code (Network)
fee (float)
currency (str)
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- currency: str¶
Withdraw fee currency
- fee: float¶
Fee amount
- class aiorocket2.models.WithdrawalFee(currency, networks)[source]¶
Bases:
BaseRepresents a WithdrawalFee entity returned by the xRocket Pay API.
- Parameters:
currency (str)
networks (List[WithdrawalCoinFees])
- as_dict(keep_enums=False, keep_datetime=False)¶
### Note: - To export data use method .as_dict(). - To just convert data to a dict use built-in function dict()
- Return type:
dict
- currency: str¶
ID of main currency for token
- classmethod from_api(j)[source]¶
Build WithdrawalFee from API JSON object.
- Parameters:
j (Mapping[str, Any])
- Return type:
- networks: List[WithdrawalCoinFees]¶