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
ifauthData
is not providedofferError
ifnft_id
,offer_price
aren't providedofferError
ifexpiration_days
isn't0
or7
.requestError
if request fails.
Parameters
nft_id
(str): Portals gift idoffer_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 to0
for no expiration or7
for the offer to expire in7
days. Default is7
.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