sale
sale()
async def sale(nft_id: str, price: int|float, authData: str) -> SaleResult
Sale / relist your nft
Returns
SaleResult
object
Raises
authDataError
- ifauthData
is not providedtradingError
:if
nft_id
is not providedif
price <= 0
orprice
isn'tint
orfloat
requestError
- if request fails
Parameters
authData
(str) - authentication data required for the api requestnft_id
(str) - id of the nft to list for saleprice
(int | float) - price of the nft to list for sale
SaleResult object
Methods:
.toDict()
- ConvertSaleResult
object back to the dict
Attributes:
.successful_nfts
- Returns a list of successfully listed nfts ids.failed_nfts
- Returns a list of failed to list nfts ids
Example
List all unlisted gifts for sale at floor price
from aportalsmp.gifts import myPortalsGifts, sale
from aportalsmp.auth import update_auth
import asyncio
auth = asyncio.run(update_auth(api_id=123, api_hash="..."))
async def main():
myUnlistedGifts = await myPortalsGifts(listed = False, authData = auth)
for gift in myUnlistedGifts:
result = await sale(nft_id = gift.id, price = gift.floor_price, authData = auth
if gift.id in result.successful_nfts:
print(f"Listed {gift.name} at {gift.floor_price} TON successfully")
See used functions: update_auth, myPortalsGifts
Last updated