myActivity

myActivity()

async def myActivity(offset: int, limit: int, authData: str) -> list[MyActivity]

Retrieve your activity

Returns

list of MyActivity 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.

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

MyActivity object

Methods:

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

Attributes:

Attributes:

  • .nft: Returns a PortalsGift 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 is offer . Else None.

  • .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 is offer, else None.

  • .offer_price: returns offer price if activity type is offer, else None.

  • .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