Source code for pyrogram.raw.types.onramp_provider_info

#  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 OnrampProviderInfo(TLObject): # type: ignore """ Constructor of :obj:`~pyrogram.raw.base.OnrampProviderInfo`. Details: - Layer: ``230`` - ID: ``DC27582`` Parameters: id (``str``): N/A name (``str``): N/A crypto_currencies (List of ``str``): N/A supports_base_currencies (``bool``, *optional*): N/A supports_limits (``bool``, *optional*): N/A supports_quote (``bool``, *optional*): N/A Functions: This object can be returned by 1 function. .. currentmodule:: pyrogram.raw.functions .. autosummary:: :nosignatures: payments.GetOnrampProviders """ __slots__: List[str] = ["id", "name", "crypto_currencies", "supports_base_currencies", "supports_limits", "supports_quote"] ID = 0xdc27582 QUALNAME = "types.OnrampProviderInfo" def __init__(self, *, id: str, name: str, crypto_currencies: List[str], supports_base_currencies: Optional[bool] = None, supports_limits: Optional[bool] = None, supports_quote: Optional[bool] = None) -> None: self.id = id # string self.name = name # string self.crypto_currencies = crypto_currencies # Vector<string> self.supports_base_currencies = supports_base_currencies # flags.0?true self.supports_limits = supports_limits # flags.1?true self.supports_quote = supports_quote # flags.2?true @staticmethod def read(b: BytesIO, *args: Any) -> "OnrampProviderInfo": flags = Int.read(b) supports_base_currencies = True if flags & (1 << 0) else False supports_limits = True if flags & (1 << 1) else False supports_quote = True if flags & (1 << 2) else False id = String.read(b) name = String.read(b) crypto_currencies = TLObject.read(b, String) return OnrampProviderInfo(id=id, name=name, crypto_currencies=crypto_currencies, supports_base_currencies=supports_base_currencies, supports_limits=supports_limits, supports_quote=supports_quote) def write(self, *args) -> bytes: b = BytesIO() b.write(Int(self.ID, False)) flags = 0 flags |= (1 << 0) if self.supports_base_currencies else 0 flags |= (1 << 1) if self.supports_limits else 0 flags |= (1 << 2) if self.supports_quote else 0 b.write(Int(flags)) b.write(String(self.id)) b.write(String(self.name)) b.write(Vector(self.crypto_currencies, String)) return b.getvalue()