Схемы
Application
Bases: BaseModel
Application info.
Attributes:
Name | Type | Description |
---|---|---|
app_id |
int
|
Application unique ID. |
name |
str
|
Application name. |
payment_processing_bot_username |
str
|
Username of Crypto bot. |
Source code in src/CryptoPayAPI/schemas.py
153 154 155 156 157 158 159 160 161 162 163 |
|
Assets
Bases: Enum
Currency code.
Attributes:
Name | Type | Description |
---|---|---|
BTC |
str
|
Bitcoin |
TON |
str
|
Toncoin |
ETH |
str
|
Ethereum |
USDT |
str
|
Tether |
USDC |
str
|
USD Coin |
BUSD |
str
|
Binance USD |
Source code in src/CryptoPayAPI/schemas.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
Balance
Bases: BaseModel
Balance info.
Attributes:
Name | Type | Description |
---|---|---|
currency_code |
str
|
Currency code. |
available |
Decimal
|
Available for using. |
Source code in src/CryptoPayAPI/schemas.py
166 167 168 169 170 171 172 173 174 |
|
Currency
Bases: BaseModel
Currency info.
Attributes:
Name | Type | Description |
---|---|---|
is_blockchain |
bool
|
Is blockchain asset? |
is_stablecoin |
bool
|
Is stable coin? |
is_fiat |
bool
|
Is fiat asset? |
name |
str
|
Name of currency. |
code |
str
|
Code of currency. |
url |
Optional[str]
|
Optional. URL of currency site. |
decimals |
int
|
? |
Source code in src/CryptoPayAPI/schemas.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|
ExchangeRate
Bases: BaseModel
Exchange rate info.
Attributes:
Name | Type | Description |
---|---|---|
is_valid |
bool
|
Is valid? |
source |
str
|
Source asset. |
target |
str
|
Target asset. |
rate |
Decimal
|
Exchange rate. |
Source code in src/CryptoPayAPI/schemas.py
177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
Invoice
Bases: BaseModel
Invoice info.
Attributes:
Name | Type | Description |
---|---|---|
invoice_id |
int
|
Unique ID for this invoice. |
status |
InvoiceStatus
|
Status of the invoice. |
hash |
str
|
Hash of the invoice. |
asset |
Assets
|
Currency code. |
amount |
Decimal
|
Amount of the invoice. |
pay_url |
str
|
URL should be presented to the user to pay the invoice. |
description |
Optional[str]
|
Optional. Description for this invoice. |
created_at |
datetime
|
Date the invoice was created in ISO 8601 format. |
allow_comments |
bool
|
|
allow_anonymous |
bool
|
|
expiration_date |
Optional[datetime]
|
Optional. Date the invoice expires in Unix time. |
paid_at |
Optional[datetime]
|
Optional. Date the invoice was paid in Unix time. |
paid_anonymously |
Optional[bool]
|
|
comment |
Optional[str]
|
Optional. Comment to the payment from the user. |
hidden_message |
Optional[str]
|
Optional. Text of the hidden message for this invoice. |
payload |
Optional[str]
|
Optional. Previously provided data for this invoice. |
paid_btn_name |
Optional[PaidButtonNames]
|
Optional. Name of the button. |
paid_btn_url |
Optional[str]
|
Optional. URL of the button. |
fee |
Optional[Decimal]
|
Optional. Amount of charged service fees. Returned only if the invoice has paid status. |
usd_rate |
Optional[Decimal]
|
Optional. Price of the asset in USD. Returned only if the invoice has paid status. |
Source code in src/CryptoPayAPI/schemas.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
InvoiceStatus
Bases: Enum
Status of invoice.
Attributes:
Name | Type | Description |
---|---|---|
ACTIVE |
str
|
'active' |
PAID |
str
|
'paid' |
EXPIRED |
str
|
'expired' |
Source code in src/CryptoPayAPI/schemas.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
PaidButtonNames
Bases: Enum
Name of the button.
Attributes:
Name | Type | Description |
---|---|---|
VIEW_ITEM |
str
|
'viewItem' |
OPEN_CHANNEL |
str
|
'openChannel' |
OPEN_BOT |
str
|
'openBot' |
CALLBACK |
str
|
'callback' |
Source code in src/CryptoPayAPI/schemas.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
Transfer
Bases: BaseModel
Transfer info.
Attributes:
Name | Type | Description |
---|---|---|
transfer_id |
int
|
Unique ID for this transfer. |
user_id |
int
|
Telegram user ID the transfer was sent to. |
asset |
Assets
|
Currency code. |
amount |
Decimal
|
Amount of the transfer. |
status |
Literal['completed']
|
Status of the transfer, can be “completed”. |
completed_at |
datetime
|
Date the transfer was completed in ISO 8601 format. |
comment |
Optional[str]
|
Optional. Comment for this transfer. |
Source code in src/CryptoPayAPI/schemas.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
Update
Bases: BaseModel
Webhook update object.
Attributes:
Name | Type | Description |
---|---|---|
update_id |
int
|
Non-unique update ID. |
update_type |
UpdateType
|
Webhook update type. |
request_date |
datetime
|
Date the request was sent in ISO 8601 format. |
payload |
Invoice
|
Payload contains |
raw_body |
Optional[bytes]
|
Optional. Raw body of update, for check sign purpose. |
Source code in src/CryptoPayAPI/schemas.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
check_signature(api_key, sign)
Check update signature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key |
str
|
CryptoPay app API key. |
required |
sign |
str
|
Update signature. In request headers |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
Is signature verified? |
Source code in src/CryptoPayAPI/schemas.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
UpdateType
Bases: Enum
Webhook update type.
Attributes:
Name | Type | Description |
---|---|---|
INVOICE_PAID |
str
|
'invoice_paid |
Source code in src/CryptoPayAPI/schemas.py
76 77 78 79 80 81 82 |
|
Дата создания: 11 января 2023 г.