makeOffer

makeOffer()

async def makeOffer(nft_id: str, offer_price: int | float, expiration_days: int, authData: str) -> None

Create an offer for a certain gift by id of the gift

Returns

None if offer was created successfully

Raises

  • authDataError if authData is not provided

  • offerError if nft_id, offer_price aren't provided

  • offerError if expiration_days isn't 0 or 7.

  • requestError if request fails.

Parameters

  • nft_id (str): Portals gift id

  • offer_price (int | float): The price you are offering for the NFT.

  • expiration_days (int): Duration in days after which the offer will expire. It can only be set to 0 for no expiration or 7 for the offer to expire in 7 days. Default is 7.

  • authData (str): Authentication data required to create the offer.

Example

Make offer for one of the latest gifts with price 10% lower:

from aportalsmp.gifts import search
from aportalsmp.offers import makeOffer
from aportalsmp.auth import update_auth
import asyncio

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

async def main():
    latest_gifts = await search(sort = "latest", authData = auth)
    gift = latest_gifts[0]
    print(await makeOffer(nft_id = gift.id, offer_price = gift.price * 0.9, authData = auth))

See used functions: search, update_auth

Last updated