### Account Management - Get User Balances Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's available balance and frozen funds within the Portals marketplace. ```APIDOC ## Get User Balances ### Description Retrieves the user's wallet balance and frozen funds on the marketplace. ### Method Asynchronous function call ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import asyncio from aportalsmp import myBalances async def check_balances(auth_data): try: balances = await myBalances(authData=auth_data) print(f"Available Balance: {balances.balance} TON") print(f"Frozen Funds: {balances.frozen_funds} TON") print(f"Total: {balances.balance + balances.frozen_funds} TON") return balances except Exception as e: print(f"Error fetching balances: {e}") asyncio.run(check_balances("tma query_id=...")) ``` ### Response #### Success Response (200) - **balances** (object) - An object containing wallet balances: - **balance** (float) - Available balance in TON. - **frozen_funds** (float) - Frozen funds in TON. #### Response Example ```json { "balance": 50.75, "frozen_funds": 10.0 } ``` ``` -------------------------------- ### Get My Collection Offers (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves all collection offers placed by the authenticated user. It fetches offer details like name, ID, amount, progress, status, and floor price. Requires authentication data. ```python import asyncio from aportalsmp import myCollectionOffers async def get_my_collection_offers(auth_data): try: offers = await myCollectionOffers(authData=auth_data) print(f"My Collection Offers: {len(offers)}") for offer in offers: print(f"\nCollection: {offer.name} ({offer.short_name})") print(f"Offer ID: {offer.id}") print(f"Amount: {offer.amount} TON") print(f"Progress: {offer.current_nfts}/{offer.max_nfts}") print(f"Status: {offer.status}") print(f"Floor Price: {offer.floor_price} TON") return offers except Exception as e: print(f"Error fetching my collection offers: {e}") asyncio.run(get_my_collection_offers("tma query_id=...")) ``` -------------------------------- ### Get User Balances from Portals Marketplace (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's wallet balance and any frozen funds currently held on the Portals marketplace. It calculates and prints the total available funds. Requires valid authentication data. ```python import asyncio from aportalsmp import myBalances async def check_balances(auth_data): try: balances = await myBalances(authData=auth_data) print(f"Available Balance: {balances.balance} TON") print(f"Frozen Funds: {balances.frozen_funds} TON") print(f"Total: {balances.balance + balances.frozen_funds} TON") return balances except Exception as e: print(f"Error fetching balances: {e}") asyncio.run(check_balances("tma query_id=...")) ``` -------------------------------- ### Get User Points from Portals Marketplace (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's Portals Points information, including total, purchase, sell, referral, and bonus points, along with purchase and sell counts. Requires valid authentication data. ```python import asyncio from aportalsmp import myPoints async def check_points(auth_data): try: points = await myPoints(authData=auth_data) print(f"Total Points: {points.total_points}") print(f"Purchase Points: {points.purchase_points}") print(f"Sell Points: {points.sell_points}") print(f"Referral Points: {points.referral_points}") print(f"Bonus Points: {points.bonus_points}") print(f"Purchase Count: {points.purchase_count}") print(f"Sell Count: {points.sell_count}") return points except Exception as e: print(f"Error fetching points: {e}") asyncio.run(check_points("tma query_id=...")) ``` -------------------------------- ### GET /myActivity Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's trading activity history on the marketplace. This includes details about buy and sell orders, amounts, and timestamps. ```APIDOC ## GET /myActivity ### Description Retrieves the user's trading activity history on the marketplace. This includes details about buy and sell orders, amounts, and timestamps. ### Method GET ### Endpoint /myActivity ### Parameters #### Query Parameters - **offset** (integer) - Optional - The number of activities to skip. - **limit** (integer) - Optional - The maximum number of activities to return. - **authData** (string) - Required - Authentication data for the request. ### Request Example ```python activity = await myActivity( offset=0, limit=50, authData=auth_data ) ``` ### Response #### Success Response (200) - **type** (string) - The type of activity ('buy' or 'sell'). - **nft** (object) - Details about the NFT involved. - **name** (string) - The name of the gift. - **amount** (number) - The amount transacted in TON. - **created_at** (string) - The timestamp when the activity was created. - **referrer_revenue** (number) - Revenue generated from referrals, if any. #### Response Example ```json [ { "type": "buy", "nft": { "name": "Delicious Apple" }, "amount": 10.5, "created_at": "2023-10-27T10:00:00Z", "referrer_revenue": 0 } ] ``` ``` -------------------------------- ### Get All Collection Offers Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves all offers for a specific collection based on the gift name. ```APIDOC ## Get All Collection Offers ### Description Retrieves all offers for a specific collection. ### Method GET ### Endpoint /bleach-hub/aportalsmp/allCollectionOffers ### Parameters #### Path Parameters None #### Query Parameters - **gift_name** (string) - Required - The name of the collection to get all offers for. - **authData** (string) - Required - Authentication data for the request. ### Request Example ```json { "gift_name": "Delicious Apple", "authData": "tma query_id=..." } ``` ### Response #### Success Response (200) - **offers** (array) - A list of offer objects. - **id** (string) - The unique identifier of the offer. - **amount** (float) - The amount of the offer in TON. - **max_nfts** (integer) - The maximum number of NFTs included in the offer. - **current_nfts** (integer) - The number of NFTs currently committed to the offer. - **status** (string) - The current status of the offer. - **created_at** (string) - The creation date and time of the offer. #### Response Example ```json { "offers": [ { "id": "offer_uuid_1", "amount": 3.0, "max_nfts": 5, "current_nfts": 0, "status": "active", "created_at": "2023-10-20T10:00:00Z" }, { "id": "offer_uuid_2", "amount": 2.8, "max_nfts": 3, "current_nfts": 0, "status": "active", "created_at": "2023-10-21T11:00:00Z" } ] } ``` ``` -------------------------------- ### Account Management - Get User Points Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's Portals Points information, including purchase, sell, referral, and bonus points, along with purchase and sell counts. ```APIDOC ## Get User Points ### Description Retrieves the user's Portals Points information including purchase, sell, referral, and bonus points. ### Method Asynchronous function call ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import asyncio from aportalsmp import myPoints async def check_points(auth_data): try: points = await myPoints(authData=auth_data) print(f"Total Points: {points.total_points}") print(f"Purchase Points: {points.purchase_points}") print(f"Sell Points: {points.sell_points}") print(f"Referral Points: {points.referral_points}") print(f"Bonus Points: {points.bonus_points}") print(f"Purchase Count: {points.purchase_count}") print(f"Sell Count: {points.sell_count}") return points except Exception as e: print(f"Error fetching points: {e}") asyncio.run(check_points("tma query_id=...")) ``` ### Response #### Success Response (200) - **points** (object) - An object containing points and counts: - **total_points** (integer) - **purchase_points** (integer) - **sell_points** (integer) - **referral_points** (integer) - **bonus_points** (integer) - **purchase_count** (integer) - **sell_count** (integer) #### Response Example ```json { "total_points": 1500, "purchase_points": 1000, "sell_points": 400, "referral_points": 50, "bonus_points": 50, "purchase_count": 10, "sell_count": 5 } ``` ``` -------------------------------- ### Get Active Giveaways (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves a list of active giveaways from the marketplace, including details like ID, status, start/end times, participant and prize counts, minimum volume, and participation requirements. Also shows prize and required channel information. ```python import asyncio from aportalsmp import getGiveaways async def list_giveaways(auth_data): try: giveaways = await getGiveaways( offset=0, limit=20, authData=auth_data ) print(f"Active Giveaways: {len(giveaways)}") for giveaway in giveaways: print(f"\nGiveaway ID: {giveaway.id}") print(f"Status: {giveaway.status}") print(f"Starts At: {giveaway.starts_at}") print(f"Ends At: {giveaway.ends_at}") print(f"Participants: {giveaway.participants_count}") print(f"Prizes: {giveaway.prizes_count}") print(f"Min Volume: {giveaway.min_volume} TON") print(f"Require Premium: {giveaway.require_premium}") print(f"Require Boost: {giveaway.require_boost}") print(f"Is Participating: {giveaway.is_participating}") print("\nPrizes:") for prize in giveaway.prizes: print(f" - {prize.name} (Floor: {prize.floor_price} TON)") print("\nRequired Channels:") for channel in giveaway.channels: status = "✓" if channel.is_member else "✗" print(f" {status} {channel.title} (@{channel.username})") return giveaways except Exception as e: print(f"Error fetching giveaways: {e}") asyncio.run(list_giveaways("tma query_id=...")) ``` -------------------------------- ### Account Management - Get User Statistics Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's trading statistics, including total items bought, total items sold, and total trading volume in TON. ```APIDOC ## Get User Statistics ### Description Retrieves the user's trading statistics including total bought, sold, and volume. ### Method Asynchronous function call ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python import asyncio from aportalsmp import myStats async def check_stats(auth_data): try: stats = await myStats(authData=auth_data) print(f"Total Bought: {stats.total_bought}") print(f"Total Sold: {stats.total_sold}") print(f"Total Volume: {stats.total_volume} TON") return stats except Exception as e: print(f"Error fetching stats: {e}") asyncio.run(check_stats("tma query_id=...")) ``` ### Response #### Success Response (200) - **stats** (object) - An object containing trading statistics: - **total_bought** (integer) - **total_sold** (integer) - **total_volume** (float) #### Response Example ```json { "total_bought": 15, "total_sold": 8, "total_volume": 120.5 } ``` ``` -------------------------------- ### Get Gift Floor Prices with Python Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the floor prices for all gift collections in the marketplace using the aportalsmp library. It demonstrates how to access individual collection floor prices by their short name and how to retrieve all floor prices as a dictionary. Assumes valid authentication data is provided. ```python import asyncio from aportalsmp import giftsFloors async def get_floors(auth_data): try: floors = await giftsFloors(authData=auth_data) # Access floor prices by short name delicious_floor = floors.floor("deliciousapple") green_star_floor = floors.floor("greenstar") print(f"Delicious Apple Floor: {delicious_floor} TON") print(f"Green Star Floor: {green_star_floor} TON") # Get all floors as dictionary all_floors = floors.toDict() print(f"Total collections: {len(all_floors)}") return floors except Exception as e: print(f"Error fetching floors: {e}") asyncio.run(get_floors("tma query_id=...")) ``` -------------------------------- ### Get User Statistics for Portals Marketplace (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's trading statistics from the Portals marketplace, including the total number of items bought, items sold, and the total trading volume in TON. Requires valid authentication data. ```python import asyncio from aportalsmp import myStats async def check_stats(auth_data): try: stats = await myStats(authData=auth_data) print(f"Total Bought: {stats.total_bought}") print(f"Total Sold: {stats.total_sold}") print(f"Total Volume: {stats.total_volume} TON") return stats except Exception as e: print(f"Error fetching stats: {e}") asyncio.run(check_stats("tma query_id=...")) ``` -------------------------------- ### Get My Received Offers (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves offers received by the authenticated user on their gifts. It displays offer ID, amount, status, gift name, gift price, and creation timestamp. Supports pagination with offset and limit. ```python import asyncio from aportalsmp import myReceivedOffers async def get_received_offers(auth_data): try: offers = await myReceivedOffers( offset=0, limit=20, authData=auth_data ) print(f"Received Offers: {len(offers)}") for offer in offers: print(f"\nOffer ID: {offer.id}") print(f"Amount: {offer.amount} TON") print(f"Status: {offer.status}") print(f"Gift: {offer.nft.name}") print(f"Gift Price: {offer.nft.price} TON") print(f"Created: {offer.created_at}") return offers except Exception as e: print(f"Error fetching received offers: {e}") asyncio.run(get_received_offers("tma query_id=...")) ``` -------------------------------- ### Get My Placed Offers (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves offers placed by the authenticated user on other users' gifts. It includes offer details such as ID, amount, status, gift name, gift price, floor price, and expiration date. Pagination is available. ```python import asyncio from aportalsmp import myPlacedOffers async def get_placed_offers(auth_data): try: offers = await myPlacedOffers( offset=0, limit=20, authData=auth_data ) print(f"Placed Offers: {len(offers)}") for offer in offers: print(f"\nOffer ID: {offer.id}") print(f"Amount: {offer.amount} TON") print(f"Status: {offer.status}") print(f"Gift: {offer.nft.name}") print(f"Gift Listed Price: {offer.nft.price} TON") print(f"Floor Price: {offer.nft.floor_price} TON") print(f"Expires: {offer.expires_at}") return offers except Exception as e: print(f"Error fetching placed offers: {e}") asyncio.run(get_placed_offers("tma query_id=...")) ``` -------------------------------- ### Get Top Collection Offer Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the highest offer for a specific collection based on the gift name. ```APIDOC ## Get Top Collection Offer ### Description Retrieves the highest offer for a specific collection. ### Method GET ### Endpoint /bleach-hub/aportalsmp/topOffer ### Parameters #### Path Parameters None #### Query Parameters - **gift_name** (string) - Required - The name of the collection to get the top offer for. - **authData** (string) - Required - Authentication data for the request. ### Request Example ```json { "gift_name": "Delicious Apple", "authData": "tma query_id=..." } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the top offer. - **amount** (float) - The amount of the offer in TON. - **max_nfts** (integer) - The maximum number of NFTs included in the offer. - **current_nfts** (integer) - The number of NFTs currently committed to the offer. - **status** (string) - The current status of the offer. - **name** (string) - The name of the collection. - **floor_price** (float) - The floor price of the collection in TON. - **expires_at** (string) - The expiration date and time of the offer. #### Response Example ```json { "id": "top_offer_uuid", "amount": 3.0, "max_nfts": 5, "current_nfts": 0, "status": "active", "name": "Delicious Apple", "floor_price": 2.5, "expires_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### GET /marketActivity Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves recent market activity with filtering options for activity type, collection, and attributes. It allows fetching all recent activity or specific types like purchases, with options for filtering by gift name and price range. ```APIDOC ## GET /marketActivity ### Description Retrieves recent market activity with filtering options for activity type, collection, and attributes. ### Method GET ### Endpoint /marketActivity ### Parameters #### Query Parameters - **sort** (string) - Optional - Specifies the sorting order for the activity (e.g., 'latest'). - **limit** (integer) - Optional - The maximum number of activities to return. - **activityType** (string or array of strings) - Optional - Filters activity by type (e.g., 'buy', 'listing'). - **gift_name** (string or array of strings) - Optional - Filters activity by the name of the gift. - **min_price** (number) - Optional - Filters activity by minimum price. - **max_price** (number) - Optional - Filters activity by maximum price. - **authData** (string) - Required - Authentication data for the request. ### Request Example ```python # Example for fetching all recent activity activity = await marketActivity( sort="latest", limit=20, authData=auth_data ) # Example for fetching specific activity type (purchases) purchases = await marketActivity( activityType="buy", gift_name="Delicious Apple", min_price=5, max_price=100, limit=10, authData=auth_data ) # Example for multiple activity types and gift names trading_activity = await marketActivity( activityType=["buy", "listing"], gift_name=["Delicious Apple", "Green Star"], sort="latest", limit=30, authData=auth_data ) ``` ### Response #### Success Response (200) - **type** (string) - The type of market activity. - **nft** (object) - Details about the NFT involved. - **name** (string) - The name of the gift. - **model** (string) - The model of the gift. - **amount** (number) - The price or amount associated with the activity. - **created_at** (string) - The timestamp when the activity was created. #### Response Example ```json [ { "type": "buy", "nft": { "name": "Delicious Apple", "model": "model-xyz" }, "amount": 10.5, "created_at": "2023-10-27T10:00:00Z" } ] ``` ``` -------------------------------- ### Get Collection Data with Python Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves detailed information about gift collections, including floor prices, volume, and supply. The function allows specifying a limit for the number of collections to fetch and demonstrates how to access specific collection details like name, short name, floor price, supply, volume, and photo URL. Includes error handling for API requests. ```python import asyncio from aportalsmp import collections async def get_collections_data(auth_data): try: collections_data = await collections(limit=50, authData=auth_data) # Access specific collection apple_collection = collections_data.gift("Delicious Apple") if apple_collection: print(f"Collection: {apple_collection.name}") print(f"Short Name: {apple_collection.short_name}") print(f"Floor Price: {apple_collection.floor_price} TON") print(f"Total Supply: {apple_collection.supply}") print(f"Total Volume: {apple_collection.volume} TON") print(f"24h Volume: {apple_collection.day_volume} TON") print(f"Photo URL: {apple_collection.photo_url}") return collections_data except Exception as e: print(f"Error fetching collections: {e}") asyncio.run(get_collections_data("tma query_id=...")) ``` -------------------------------- ### Get Market Activity with Filtering Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves recent market activity, allowing filtering by activity type, gift name, price range, and sorting options. It utilizes the `marketActivity` function from the `aportalsmp` library and requires authentication data. ```python import asyncio from aportalsmp import marketActivity async def get_activity(auth_data): try: # Get all recent activity activity = await marketActivity( sort="latest", limit=20, authData=auth_data ) # Get specific activity type purchases = await marketActivity( activityType="buy", gift_name="Delicious Apple", min_price=5, max_price=100, limit=10, authData=auth_data ) # Multiple activity types trading_activity = await marketActivity( activityType=["buy", "listing"], gift_name=["Delicious Apple", "Green Star"], sort="latest", limit=30, authData=auth_data ) for act in trading_activity: print(f"\nActivity Type: {act.type}") print(f"Gift: {act.nft.name}") print(f"Price: {act.amount} TON") print(f"Model: {act.nft.model}") print(f"Created At: {act.created_at}") return trading_activity except Exception as e: print(f"Error fetching market activity: {e}") asyncio.run(get_activity("tma query_id=...")) ``` -------------------------------- ### GET /myPortalsGifts Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's owned gifts from the marketplace. It can fetch both listed and unlisted gifts, providing details like the gift name, ID, listed price, and status. ```APIDOC ## GET /myPortalsGifts ### Description Retrieves the user's owned gifts from the marketplace. It can fetch both listed and unlisted gifts, providing details like the gift name, ID, listed price, and status. ### Method GET ### Endpoint /myPortalsGifts ### Parameters #### Query Parameters - **offset** (integer) - Optional - The number of gifts to skip. - **limit** (integer) - Optional - The maximum number of gifts to return. - **listed** (boolean) - Required - Filters gifts by their listing status (true for listed, false for unlisted). - **authData** (string) - Required - Authentication data for the request. ### Request Example ```python # Get listed gifts listed_gifts = await myPortalsGifts( offset=0, limit=50, listed=True, authData=auth_data ) # Get unlisted gifts unlisted_gifts = await myPortalsGifts( offset=0, limit=50, listed=False, authData=auth_data ) ``` ### Response #### Success Response (200) - **name** (string) - The name of the gift. - **id** (string) - The unique identifier of the gift. - **price** (number) - The listed price of the gift in TON. - **floor_price** (number) - The current floor price of the gift in TON. - **status** (string) - The listing status of the gift (e.g., 'listed', 'unlisted'). #### Response Example ```json [ { "name": "Green Star", "id": "gift-123", "price": 15.0, "floor_price": 12.0, "status": "listed" } ] ``` ``` -------------------------------- ### Get All Collection Offers using AportalMP Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves all active offers for a given collection using the `allCollectionOffers` function. It requires the `gift_name` (collection identifier) and authentication data. The function returns a list of offers, detailing their IDs, amounts, NFT counts, status, and creation times, with built-in error handling. ```python import asyncio from aportalsmp import allCollectionOffers async def get_all_offers(auth_data): try: offers = await allCollectionOffers( gift_name="Delicious Apple", authData=auth_data ) print(f"Total Offers: {len(offers)}") for offer in offers: print(f"\nOffer ID: {offer.id}") print(f"Amount: {offer.amount} TON") print(f"Max NFTs: {offer.max_nfts} / Current: {offer.current_nfts}") print(f"Status: {offer.status}") print(f"Created: {offer.created_at}") return offers except Exception as e: print(f"Error fetching collection offers: {e}") asyncio.run(get_all_offers("tma query_id=...")) ``` -------------------------------- ### Get User's Owned Gifts (Listed and Unlisted) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's owned gifts from the marketplace, distinguishing between listed and unlisted items. It uses the `myPortalsGifts` function with a `listed` boolean parameter and requires authentication data. ```python import asyncio from aportalsmp import myPortalsGifts async def get_my_gifts(auth_data): try: # Get listed gifts listed_gifts = await myPortalsGifts( offset=0, limit=50, listed=True, authData=auth_data ) # Get unlisted gifts unlisted_gifts = await myPortalsGifts( offset=0, limit=50, listed=False, authData=auth_data ) print(f"Listed Gifts: {len(listed_gifts)}") print(f"Unlisted Gifts: {len(unlisted_gifts)}") for gift in listed_gifts: print(f"\nGift: {gift.name}") print(f"ID: {gift.id}") print(f"Listed Price: {gift.price} TON") print(f"Floor Price: {gift.floor_price} TON") print(f"Status: {gift.status}") return listed_gifts, unlisted_gifts except Exception as e: print(f"Error fetching my gifts: {e}") asyncio.run(get_my_gifts("tma query_id=...")) ``` -------------------------------- ### Get User's Trading Activity History Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the user's trading activity history on the marketplace, including details like transaction type, gift name, amount, and creation timestamp. It uses the `myActivity` function and requires authentication data. ```python import asyncio from aportalsmp import myActivity async def get_my_activity(auth_data): try: activity = await myActivity( offset=0, limit=50, authData=auth_data ) total_bought = 0 total_sold = 0 for act in activity: print(f"\nType: {act.type}") print(f"Gift: {act.nft.name}") print(f"Amount: {act.amount} TON") print(f"Created At: {act.created_at}") if act.type == "buy": total_bought += act.amount elif act.type == "sell": total_sold += act.amount if act.referrer_revenue > 0: print(f"Referrer Revenue: {act.referrer_revenue} TON") print(f"\nTotal Bought: {total_bought} TON") print(f"Total Sold: {total_sold} TON") return activity except Exception as e: print(f"Error fetching my activity: {e}") asyncio.run(get_my_activity("tma query_id=...")) ``` -------------------------------- ### Get Filtered Gift Floor Prices with Python Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves floor prices for specific attributes (models, backdrops, symbols) within a given gift collection. The function takes the gift name and authentication data as input and demonstrates how to access individual attribute floor prices and lists of all attributes with their prices. Handles potential errors during the API call. ```python import asyncio from aportalsmp import filterFloors async def get_attribute_floors(auth_data): try: filters = await filterFloors( gift_name="Delicious Apple", authData=auth_data ) if filters: # Get specific attribute floor prices model_floor = filters.model("Rare Character") backdrop_floor = filters.backdrop("Golden Background") symbol_floor = filters.symbol("Diamond") print(f"Model 'Rare Character' Floor: {model_floor} TON") print(f"Backdrop 'Golden Background' Floor: {backdrop_floor} TON") print(f"Symbol 'Diamond' Floor: {symbol_floor} TON") # Get all attributes print("\nAll Models:") for model, price in filters.models.items(): print(f" {model}: {price} TON") print("\nAll Backdrops:") for backdrop, price in filters.backdrops.items(): print(f" {backdrop}: {price} TON") return filters except Exception as e: print(f"Error fetching filters: {e}") asyncio.run(get_attribute_floors("tma query_id=...")) ``` -------------------------------- ### Get Top Collection Offer using AportalMP Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves the highest active offer for a specific collection using the `topOffer` function. It takes the `gift_name` (collection identifier) and authentication data as input. The function returns details of the top offer or indicates if none is found, with error handling. ```python import asyncio from aportalsmp import topOffer async def get_top_offer(auth_data): try: offer = await topOffer( gift_name="Delicious Apple", authData=auth_data ) if offer: print(f"Top Offer ID: {offer.id}") print(f"Amount: {offer.amount} TON") print(f"Max NFTs: {offer.max_nfts}") print(f"Current NFTs: {offer.current_nfts}") print(f"Status: {offer.status}") print(f"Collection: {offer.name}") print(f"Floor Price: {offer.floor_price} TON") print(f"Expires At: {offer.expires_at}") else: print("No top offer found") return offer except Exception as e: print(f"Error fetching top offer: {e}") asyncio.run(get_top_offer("tma query_id=...")) ``` -------------------------------- ### Join Giveaway with AportalSMP Python SDK Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Joins a giveaway if all requirements are met using the AportalSMP Python SDK. It first checks eligibility using `giveawayInfo` and then attempts to join if `can_participate` is true. Requires authentication data and the giveaway ID. Dependencies include 'asyncio' and 'aportalsmp'. ```python import asyncio from aportalsmp import joinGiveaway, giveawayInfo async def participate_in_giveaway(auth_data, giveaway_id): try: # Check eligibility first requirements = await giveawayInfo( giveaway_id=giveaway_id, authData=auth_data ) if requirements and requirements.can_participate: await joinGiveaway( giveaway_id=giveaway_id, authData=auth_data ) print("Successfully joined the giveaway!") else: print("Cannot join - requirements not met:") if requirements: if requirements.premium_missing: print(" - Premium subscription required") if requirements.boost_missing: print(" - Channel boost required") if requirements.volume_missing > 0: print(f" - Need {requirements.volume_missing} more TON volume") except Exception as e: print(f"Error joining giveaway: {e}") asyncio.run(participate_in_giveaway("tma query_id=...", "giveaway_uuid_123")) ``` -------------------------------- ### Format NFT Data for Bulk Buying with AportalSMP Python SDK Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Formats individual NFT data into a structure suitable for bulk buying operations using the AportalSMP Python SDK's `convertForBuying` function. It takes an NFT ID and price as input and returns a dictionary with 'id' and 'price'. This prepares NFT data for purchasing multiple items. ```python from aportalsmp import convertForBuying ft_data = convertForBuying( nft_id="abc123-def456-ghi789", price=5.5 ) print(nft_data) # Output: {"id": "abc123-def456-ghi789", "price": "5.5"} ``` -------------------------------- ### Make Collection Offer Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Places an offer on an entire collection, specifying the gift name, amount, expiration, and maximum number of NFTs to purchase. ```APIDOC ## Make Collection Offer ### Description Places an offer on an entire collection with a maximum number of NFTs to purchase. ### Method POST ### Endpoint /bleach-hub/aportalsmp/collectionOffer ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **gift_name** (string) - Required - The name of the collection to make an offer on. - **amount** (float) - Required - The price per NFT in TON. - **expiration_days** (integer) - Required - The number of days the offer is valid. Use 0 for a permanent offer. - **max_nfts** (integer) - Required - The maximum number of NFTs to purchase. - **authData** (string) - Required - Authentication data for the request. ### Request Example ```json { "gift_name": "Delicious Apple", "amount": 3.0, "expiration_days": 7, "max_nfts": 5, "authData": "tma query_id=..." } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the offer was placed. #### Response Example ```json { "message": "Collection offer placed!" } ``` ``` -------------------------------- ### Place Collection Offer using AportalMP Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Places an offer on an entire collection using the `collectionOffer` function. This function can be used for both temporary and permanent offers, allowing specification of the collection name, bid amount, expiration, and the maximum number of NFTs to purchase. Error handling is included. ```python import asyncio from aportalsmp import collectionOffer async def place_collection_offer(auth_data): try: # Offer to buy up to 5 Delicious Apples at 3 TON each await collectionOffer( gift_name="Delicious Apple", amount=3.0, expiration_days=7, max_nfts=5, authData=auth_data ) print("Collection offer placed!") # Permanent collection offer await collectionOffer( gift_name="Green Star", amount=15.0, expiration_days=0, max_nfts=1, authData=auth_data ) print("Permanent collection offer placed!") except Exception as e: print(f"Error making collection offer: {e}") asyncio.run(place_collection_offer("tma query_id=...")) ``` -------------------------------- ### Format NFT Data for Bulk Listing with AportalSMP Python SDK Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Formats individual NFT data into a structure suitable for bulk listing operations using the AportalSMP Python SDK's `convertForListing` function. It takes an NFT ID and price as input and returns a dictionary with 'nft_id' and 'price'. Useful for preparing multiple NFTs for sale. ```python from aportalsmp import convertForListing nft_data = convertForListing( nft_id="abc123-def456-ghi789", price=5.5 ) print(nft_data) # Output: {"nft_id": "abc123-def456-ghi789", "price": "5.5"} # Use in bulk listing nfts = [ convertForListing("nft_1", 5.0), convertForListing("nft_2", 7.5), convertForListing("nft_3", 3.25) ] ``` -------------------------------- ### POST /buy Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Purchases a gift from the marketplace at a specified price. It returns the status of the purchase, including requested amounts, purchased amounts, and any failures. ```APIDOC ## POST /buy ### Description Purchases a gift from the marketplace at a specified price. It returns the status of the purchase, including requested amounts, purchased amounts, and any failures. ### Method POST ### Endpoint /buy ### Parameters #### Request Body - **nft_id** (string) - Required - The unique identifier of the NFT to purchase. - **price** (number) - Required - The price at which to purchase the NFT. - **authData** (string) - Required - Authentication data for the request. ### Request Example ```python result = await buy( nft_id="fea0382a-dc66-4173-8a31-680b0ac55671", price=2.5, authData=auth_data ) ``` ### Response #### Success Response (200) - **total_requested** (integer) - The total number of items requested for purchase. - **total_purchased** (integer) - The total number of items successfully purchased. - **total_failed** (integer) - The total number of purchase attempts that failed. - **total_spent** (number) - The total amount spent in TON. - **purchase_results** (array) - A list of individual purchase results. - **id** (string) - The NFT ID for this purchase result. - **status** (string) - The status of the individual purchase (e.g., 'success', 'failed'). - **price** (number) - The price of this individual purchase. - **reason** (string) - The reason for failure, if applicable. - **error_message** (string) - Detailed error message, if applicable. #### Response Example ```json { "total_requested": 1, "total_purchased": 1, "total_failed": 0, "total_spent": 2.5, "purchase_results": [ { "id": "fea0382a-dc66-4173-8a31-680b0ac55671", "status": "success", "price": 2.5 } ] } ``` ``` -------------------------------- ### Check Giveaway Eligibility with AportalSMP Python SDK Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Retrieves detailed requirements and eligibility information for a specific giveaway using the AportalSMP Python SDK. It takes authentication data as input and outputs giveaway participation status, requirements, and any missing criteria. Dependencies include the 'asyncio' and 'aportalsmp' libraries. ```python import asyncio from aportalsmp import giveawayInfo async def check_giveaway_eligibility(auth_data): try: requirements = await giveawayInfo( giveaway_id="giveaway_uuid_123", authData=auth_data ) if requirements: print(f"Can Participate: {requirements.can_participate}") print(f"Already Participating: {requirements.is_already_participating}") print(f"Giveaway Status: {requirements.giveaway_status}") print(f"Is Active: {requirements.is_active}") print(f"Has Ended: {requirements.has_ended}") print("\nRequirements:") print(f" Premium Required: {requirements.require_premium}") print(f" Boost Required: {requirements.require_boost}") print(f" Min Volume: {requirements.min_volume} TON") print("\nMissing Requirements:") if requirements.premium_missing: print(" ✗ Premium subscription needed") if requirements.boost_missing: print(" ✗ Channel boost needed") if requirements.volume_missing > 0: print(f" ✗ Need {requirements.volume_missing} more TON volume") print(f" (Current: {requirements.user_volume} TON)") if requirements.channels_missing: print("\n Missing channel memberships:") for channel in requirements.channels_missing: print(f" - {channel.title} (@{channel.username})") return requirements except Exception as e: print(f"Error fetching giveaway requirements: {e}") asyncio.run(check_giveaway_eligibility("tma query_id=...")) ``` -------------------------------- ### List Single Gift for Sale using Aportal SMP API (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Lists a single gift for sale on the marketplace with a specified price. Requires authentication data and a valid NFT ID. Returns the number of successful and failed listings. ```python import asyncio from aportalsmp import sale async def list_gift(auth_data): try: result = await sale( nft_id="abc123-def456-ghi789", price=5.75, authData=auth_data ) print(f"Successful NFTs: {len(result.successful_nfts)}") print(f"Failed NFTs: {len(result.failed_nfts)}") for nft_id in result.successful_nfts: print(f"Successfully listed: {nft_id}") for failed in result.failed_nfts: print(f"Failed to list: {failed}") return result except Exception as e: print(f"Error listing gift: {e}") asyncio.run(list_gift("tma query_id=...")) ``` -------------------------------- ### Bulk List Gifts for Sale using Aportal SMP API (Python) Source: https://context7.com/bleach-hub/aportalsmp/llms.txt Lists multiple gifts for sale in a single API operation. It accepts a list of gift objects, each containing an NFT ID and price. Handles both direct price input and prepared gift formats. Returns summary counts of successful and failed listings. ```python import asyncio from aportalsmp import bulkList, convertForListing async def bulk_list_gifts(auth_data): try: # Prepare NFTs for listing nfts = [ convertForListing("nft_id_1", 5.0), convertForListing("nft_id_2", 7.5), convertForListing("nft_id_3", 3.25), {"nft_id": "nft_id_4", "price": "10.0"} # Alternative format ] result = await bulkList(nfts=nfts, authData=auth_data) print(f"Successfully listed: {len(result.successful_nfts)} gifts") print(f"Failed to list: {len(result.failed_nfts)} gifts") for nft_id in result.successful_nfts: print(f" ✓ {nft_id}") for nft_id in result.failed_nfts: print(f" ✗ {nft_id}") return result except Exception as e: print(f"Error bulk listing: {e}") asyncio.run(bulk_list_gifts("tma query_id=...")) ```