Source code for pyrogram.raw.functions.wallet.send_transfer
# 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 SendTransfer(TLObject): # type: ignore
"""
Details:
- Layer: ``230``
- ID: ``D9E5D9E2``
Parameters:
data_normal (``bytes``):
N/A
user_id (:obj:`InputUser <pyrogram.raw.base.InputUser>`):
N/A
random_id (``int`` ``64-bit``):
N/A
data_gasless (``bytes``, *optional*):
N/A
Returns:
:obj:`Updates <pyrogram.raw.base.Updates>`
"""
__slots__: List[str] = ["data_normal", "user_id", "random_id", "data_gasless"]
ID = 0xd9e5d9e2
QUALNAME = "functions.wallet.SendTransfer"
def __init__(self, *, data_normal: bytes, user_id: "raw.base.InputUser", random_id: int, data_gasless: Optional[bytes] = None) -> None:
self.data_normal = data_normal # bytes
self.user_id = user_id # InputUser
self.random_id = random_id # long
self.data_gasless = data_gasless # flags.0?bytes
@staticmethod
def read(b: BytesIO, *args: Any) -> "SendTransfer":
flags = Int.read(b)
data_normal = Bytes.read(b)
data_gasless = Bytes.read(b) if flags & (1 << 0) else None
user_id = TLObject.read(b)
random_id = Long.read(b)
return SendTransfer(data_normal=data_normal, user_id=user_id, random_id=random_id, data_gasless=data_gasless)
def write(self, *args) -> bytes:
b = BytesIO()
b.write(Int(self.ID, False))
flags = 0
flags |= (1 << 0) if self.data_gasless is not None else 0
b.write(Int(flags))
b.write(Bytes(self.data_normal))
if self.data_gasless is not None:
b.write(Bytes(self.data_gasless))
b.write(self.user_id.write())
b.write(Long(self.random_id))
return b.getvalue()