Skip to content

Asset Management

S1qwy edited this page Oct 15, 2026 · 3 revisions

Asset Management

14.0.0 / User-owned operations

Home / Asset Management / Data Models


Important

Account operations require your own authenticated cookie session. Restricted wallet-auth mode blocks these methods before shared authentication is attempted.

Capability requirements

Operation class Local prerequisites
Profile, private history, assets, sessions Cookie mode
Bids, offers, listing transactions, NFT transfer Cookie mode, stel_ton_token, payer seed, provider key
Withdrawal initialization and confirmation Cookie mode and a constructible destination account
Assignment and subscriptions Cookie mode; additional payment requirements may apply

Server-side ownership, verification, and authorization checks still apply.

Profile and inventory

Method Purpose
get_profile() User profile and linked-wallet information
get_my_assets(item_type="usernames") Owned assets
get_my_bids(item_type="usernames", sort="desc") Account bid history
get_assign_accounts(item_type, slug) Telegram assignment destinations

Inventory categories are usernames, numbers, and gifts.

Numeric asset types are:

Type Asset
1 Username
3 Anonymous number
5 Gift

Pass the item's bare identifier to write methods, rather than assuming every write payload normalizes listing-path prefixes.

Auctions and offers

Method Parameters
place_bid item_type, slug, bid
make_offer item_type, slug, amount
start_auction item_type, slug, min_amount, max_amount=0
sell_asset item_type, slug, price
cancel_auction item_type, slug

Amounts are integer native TON.

For start_auction, a nonzero maximum must not be lower than the minimum. sell_asset supplies the same value as both minimum and maximum.

These methods return transaction or operation receipts. Do not interpret a returned broadcast identifier as completed marketplace settlement.

The current account transaction helper can report a signed BOC but does not run the purchase-flow fulfillment poller. Account transaction confirmed fields can therefore remain False after a successful broadcast.

Server rules determine whether a particular asset can be listed, cancelled, or purchased through a bid operation.

Assignment

assign_to_telegram(item_type, slug, assign_to=None, wait_for_bot_payment=True)

  • Resolve destinations with get_assign_accounts.
  • Supply the selected account ID as assign_to.
  • Inspect need_pay and the quoted amount.
  • Set wait_for_bot_payment=False when you do not want automatic assignment payment.
  • The default may pay an explicitly quoted assignment charge when a payer is configured.

AssignResult.ok is not sufficient by itself to distinguish a completed assignment from a response that still requires payment. Inspect the remaining fields.

Notifications

  • subscribe_to_item(item_type, slug)
  • unsubscribe_from_item(item_type, slug)

Both return SubscriptionResult.

NFT transfer

The transfer flow has three steps:

  1. search_nft_transfer_recipient(query)
  2. init_nft_transfer(slug, recipient)
  3. transfer_nft(req_id, show_sender=True)

The second argument to initialization is the resolved Fragment recipient token, not an arbitrary wallet address.

Review the requested asset and destination before broadcasting.

Withdrawals

Withdrawals use Fragment-provided opaque identifiers and approval challenges.

Do not fabricate a confirmation hash or automatically approve a challenge without reviewing the destination and operation.

NFT

Method Parameters
get_nft_withdrawal_state transaction
init_nft_withdrawal transaction, keep_gift=False
confirm_nft_withdrawal transaction, confirm_hash, keep_gift=False

Stars revenue

Method Parameters
get_stars_withdrawal_state transaction
init_stars_withdrawal transaction, withdrawal_data
confirm_stars_withdrawal transaction, withdrawal_data, confirm_hash

Preserve the original withdrawal_data associated with the approval flow.

Ads revenue

Method Parameters
init_ads_withdrawal transaction_id
confirm_ads_withdrawal transaction_id, confirm_hash

Withdrawal calls build the destination from sender_account or the configured seed. They do not inherently require a blockchain provider key merely to submit the Fragment request.

Withdrawal responses may contain errors in their result models. Inspect ok, error, confirm_hash, and completion state.

Anonymous numbers

Only operate on numbers owned by the authenticated account.

Method Purpose
get_login_code(number) Read a pending login code
toggle_login_codes(number, can_receive) Enable or disable delivery
terminate_sessions(number) Terminate associated Telegram sessions

can_receive must be a real boolean.

Login codes are secrets. Avoid logging the result through serialization even though its custom diagnostic representation omits the code.

terminate_sessions performs its internal two-step request flow. The method is a destructive action, not a preview.

Fragment sessions

Method Purpose
get_sessions() List active Fragment sessions
list_sessions() Alias for get_sessions
terminate_session(session_id) Terminate one explicitly selected session
refresh_cookies() Refresh wallet proof

Terminating a Fragment session and terminating Telegram sessions for an anonymous number are different operations.

Ads and Gateway are separate workflows

recharge_ads, get_gateway_price, and recharge_gateway belong to the invoice purchase engine.

They are not automatically blocked merely because private asset management is unavailable. See Purchases and Giveaways.


Examples: Marketplace management · NFTs and withdrawals · Anonymous numbers

Clone this wiki locally