myPortalsGifts

myPortalsGifts()

async def myPortalsGifts(offset: int, limit: int, listed: bool, authData: str) -> list[PortalsGift]

Retrieve your listed / unlisted gifts

Returns

list of PortalsGift objects.

Raises

  • authDataError - if authData is not provided

  • requestError - if request fails

Parameters

  • offset (int) - pagination offset. For example, to get second page you need to set offset to 1*limit , third - 2*limit etc. Default is 0.

  • limit (int) - limit of gifts to show. Default is 20.

  • listed (bool) - whether to show listed or unlisted gifts. Default is True.

  • authData (str) - authentication data required for the api request

PortalsGift object

Methods:

  • .toDict(): Converts the PortalsGift object back to a dictionary format.

Attributes:

  • .id: The ID of the NFT.

  • .tg_id: Telegram number of the gift (an external collection number).

  • .collection_id: The ID of the gift collection.

  • .name: Name of the gift.

  • .photo_url: URL of the photo from Fragment representing the gift (first frame of Lottie animation in PNG).

  • .price: Price of the gift.

  • .model: Model of the gift.

  • .model_rarity: Rarity percentage of the model.

  • .backdrop: Backdrop of the gift.

  • .backdrop_rarity: Rarity percentage of the backdrop.

  • .symbol: Symbol of the gift.

  • .symbol_rarity: Rarity percentage of the symbol.

  • .listed_at: Date and time when the gift has been listed for sale.

  • .status: Status of the gift (possible values: "listed", "unlisted", "withdrawn").

  • .animation_url: URL to the Lottie animation of the gift.

  • .emoji_id: Custom Telegram emoji ID for the gift.

  • .floor_price: Floor price of the gift's collection.

  • .unlocks_at: Date and time when the gift will be mintable (unsure if correct).

Example

Print all listed gifts

from aportalsmp.gifts import myPortalsGifts
from aportalsmp.auth import update_auth
import asyncio

auth = asyncio.run(update_auth(api_id=123, api_hash="..."))

async def main():
    mygifts = await myPortalsGifts(listed = True, authData = auth)
    for gift in mygifts:
        print(gift.name, gift.tg_id, gift.price)

See used functions: update_auth

Last updated