myActivity
myActivity()
async def myActivity(offset: int, limit: int, authData: str) -> list[MyActivity]
Retrieve your activity
Returns
list
of MyActivity
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
.authData
(str) - authentication data required for the api request
MyActivity object
Methods:
.toDict()
: Converts thePortalsGift
object back to a dictionary format.
Attributes:
Attributes:
.nft
: Returns aPortalsGift
object. See PortalsGift.target_user_id
: ⚠️ Not sure about this one.nft_id
: id of the nft.offer_id
: Returns id of the offer, if the activity type isoffer
. ElseNone
..type
: type of activity.amount
: returns amount of TON for the activity.created_at
: activity creation date+time.referrer_revenue
: revenue your referrer got for the activity.collection_id
: id of the collection of the nft.metadata
: ⚠️ almost always empty, not sure about this one.offer_status
: returns offer status if activity type isoffer
, elseNone
..offer_price
: returns offer price if activity type isoffer
, elseNone
..recipient_id
: ⚠️ Not sure about this one (it's always your Telegram user id)
Example
Print all recent activities
from aportalsmp.gifts import myActivity
from aportalsmp.auth import update_auth
import asyncio
auth = asyncio.run(update_auth(api_id=123, api_hash="..."))
async def main():
myact = await myActivity(authData = auth)
for act in myact:
print(act.nft.name, act.type, act.amount, act.created_at)
See used functions: update_auth
Last updated