Source code for pyrogram.raw.types.onramp_quote

#  Pyrogram - Telegram MTProto API Client Library for Python
#  Copyright (C) 2017-present Dan <https://github.com/delivrance>
#
#  This file is part of Pyrogram.
#
#  Pyrogram is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published
#  by the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  Pyrogram is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with Pyrogram.  If not, see <http://www.gnu.org/licenses/>.

from io import BytesIO

from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Optional, Any

# # # # # # # # # # # # # # # # # # # # # # # #
#               !!! WARNING !!!               #
#          This is a generated file!          #
# All changes made in this file will be lost! #
# # # # # # # # # # # # # # # # # # # # # # # #


[docs] class OnrampQuote(TLObject): # type: ignore """ Constructor of :obj:`~pyrogram.raw.base.OnrampQuote`. Details: - Layer: ``230`` - ID: ``7A8011E9`` Parameters: base_currency (``str``): N/A base_amount (``str``): N/A crypto_currency (``str``): N/A crypto_amount (``str``): N/A crypto_price (``str``): N/A fee_amount (``str``): N/A extra_fee_amount (``str``): N/A network_fee_amount (``str``): N/A total_amount (``str``): N/A payment_method (``str``): N/A expires_date (``int`` ``32-bit``): N/A Functions: This object can be returned by 1 function. .. currentmodule:: pyrogram.raw.functions .. autosummary:: :nosignatures: payments.GetOnrampQuote """ __slots__: List[str] = ["base_currency", "base_amount", "crypto_currency", "crypto_amount", "crypto_price", "fee_amount", "extra_fee_amount", "network_fee_amount", "total_amount", "payment_method", "expires_date"] ID = 0x7a8011e9 QUALNAME = "types.OnrampQuote" def __init__(self, *, base_currency: str, base_amount: str, crypto_currency: str, crypto_amount: str, crypto_price: str, fee_amount: str, extra_fee_amount: str, network_fee_amount: str, total_amount: str, payment_method: str, expires_date: int) -> None: self.base_currency = base_currency # string self.base_amount = base_amount # string self.crypto_currency = crypto_currency # string self.crypto_amount = crypto_amount # string self.crypto_price = crypto_price # string self.fee_amount = fee_amount # string self.extra_fee_amount = extra_fee_amount # string self.network_fee_amount = network_fee_amount # string self.total_amount = total_amount # string self.payment_method = payment_method # string self.expires_date = expires_date # int @staticmethod def read(b: BytesIO, *args: Any) -> "OnrampQuote": # No flags base_currency = String.read(b) base_amount = String.read(b) crypto_currency = String.read(b) crypto_amount = String.read(b) crypto_price = String.read(b) fee_amount = String.read(b) extra_fee_amount = String.read(b) network_fee_amount = String.read(b) total_amount = String.read(b) payment_method = String.read(b) expires_date = Int.read(b) return OnrampQuote(base_currency=base_currency, base_amount=base_amount, crypto_currency=crypto_currency, crypto_amount=crypto_amount, crypto_price=crypto_price, fee_amount=fee_amount, extra_fee_amount=extra_fee_amount, network_fee_amount=network_fee_amount, total_amount=total_amount, payment_method=payment_method, expires_date=expires_date) def write(self, *args) -> bytes: b = BytesIO() b.write(Int(self.ID, False)) # No flags b.write(String(self.base_currency)) b.write(String(self.base_amount)) b.write(String(self.crypto_currency)) b.write(String(self.crypto_amount)) b.write(String(self.crypto_price)) b.write(String(self.fee_amount)) b.write(String(self.extra_fee_amount)) b.write(String(self.network_fee_amount)) b.write(String(self.total_amount)) b.write(String(self.payment_method)) b.write(Int(self.expires_date)) return b.getvalue()