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
- ifauthData
is not providedrequestError
- if request fails
Parameters
offset
(int) - pagination offset. For example, to get second page you need to setoffset
to1*limit
, third -2*limit
etc. Default is0
.limit
(int) - limit of gifts to show. Default is20
.listed
(bool) - whether to show listed or unlisted gifts. Default isTrue
.authData
(str) - authentication data required for the api request
PortalsGift object
Methods:
.toDict()
: Converts thePortalsGift
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