v0.0.4 · 105 endpoints · API عام للجميع

Fragment.com API — للجميع

Full automation API for Fragment.com — Telegram marketplace on TON blockchain. Multi-tenant: anyone can use it with their own key. TON wallet auto-pay, scheduled sniper, bulk purchases, structured marketplace data and persistent sessions. واجهة برمجة كاملة لمنصة Fragment للأصول على TON — أي شخص يستخدمها مباشرة: اربط محفظتك بمفتاحك الخاص (تشفير بمفتاحك) أو بعنوانها فقط، واحفظ كوكيزك مرة واحدة ثم شغّل كل شيء.
105Endpoint
22قسم
v0.0.4الإصدار
0إعدادات مطلوبة من المشغّل

🚀 كيف تبدأ في أقل من دقيقة

1
مفتاحك الخاص
أي X-API-Key: anything تختاره يصبح هويتك — به تتشفّر وتُعزل محفظتك وجلساتك ومهامك. يُرسَل في الـ header وليس في الرابط أبداً.
2
سجّل محفظة TON
إمّا بالعنوان فقط (read-only، بلا مفتاح): POST /api/wallet/setup {"address":"UQ..."}، أو بالكلمات الـ24 لمفتاحك ليشتغل الدفع التلقائي: {"seed":"word1 ... word24"}.
3
سجّل الدخول عبر Telegram (مرة واحدة)
افتح صفحة تسجيل الدخول — يتولّد مفتاح عشوائي تلقائياً، أدخل رقمك وأكّده في تليجرام فتُحفظ الجلسة تحت مفتاحك. أو عبر API: POST /api/auth/telegram/start {"phone":"9665XXXXXXXX"} ثم اقرأ POST /api/auth/telegram/status. ولصق يدوي متاح أيضاً: POST /api/session/save {"cookie":"stel_dt=..; stel_ssid=..; stel_token=.."}.
4
استخدم أي endpoint بالأسفل
اشترِ Stars وأهدِ Premium، راجع السوق (JSON)، سلّح Sniping، وتتبّع مدفوعاتك عبر /api/tx/status.

⚡ إعداد المحفظة (مرة واحدة) — الدفع التلقائي

# 1. أضف محفظة TON (24 كلمة)
curl -X POST "https://fragment-api.contact-3mh.workers.dev/api/wallet/setup"   -H "X-API-Key: " -H "Content-Type: application/json"   -d '{"seed":"word1 word2 ... word24"}'
# أو سجّل محفظة خارجية بالعنوان فقط (بدون مفتاح):
curl -X POST "https://fragment-api.contact-3mh.workers.dev/api/wallet/setup"   -H "Content-Type: application/json" -d '{"address":"UQ..."}'

# 2. اشترِ Stars وسيُدفع تلقائياً من محفظتك
curl -X POST "https://fragment-api.contact-3mh.workers.dev/api/stars/buy"   -H "X-API-Key: "   -H "Cookie: stel_dt=-240; stel_ssid=xxx; stel_token=xxx; stel_ton_token=xxx"   -H "Content-Type: application/json"   -d '{"recipient":"durov","quantity":"100","auto_pay":"1"}'

# 3. افحص محفظتك (بمفتاحك أو بعنوانك)
curl "https://fragment-api.contact-3mh.workers.dev/api/wallet" -H "X-API-Key: <your-key>"
# أو بالعنوان العام (بدون مفتاح):
curl "https://fragment-api.contact-3mh.workers.dev/api/wallet?address=UQ..."
👥 متعدد المستخدمين: API عام — كل مستخدم يرسل مفتاحه الخاص (X-API-Key: anything) فيصير هوية محفظته وجلساته وسنابراته (مشفّرة AES-256-GCM بمفتاحه). يمكن أيضاً تسجيل محفظة خارجية بالعنوان فقط read-only بدون مفتاح. العمليات الأخرى (شراء/بحث/مزادات) تحتاج كوكيز الجلسة كـ Cookie header.

── Utility / Docs ──

MethodEndpointDescription
GET/Interactive HTML documentation (this page)
GET/docs.txtPlain-text documentation
GET/healthHealth check
GET/api/loginTelegram login page (auto-generated key, one-click login)
GET/api/keyGenerate a fresh random API key {ok, key}
GET/api/hashGet fresh API hash
GET/api/sessionCheck saved/current session validity
POST/api/session/saveSave cookies ONCE (validated, AES-256-GCM)
DELETE/api/sessionClear saved session
GET/api/session/helperBrowser snippet to copy your cookies
POST/api/rawCall any Fragment API method directly
GET/api/pageScrape raw marketplace page HTML
GET/api/marketplaceStructured JSON listings {type, sort, filter, q, limit}

── Telegram Login (auto session) ──

MethodEndpointDescription
POST/api/auth/telegram/startStart login {phone, stel_dt?} — Telegram pushes a confirm request → {session_id} — your key
POST/api/auth/telegram/statusPoll {session_id} → {status:'waiting'} until confirmed → logs into Fragment and SAVES the session — your key
POST/api/auth/telegram/finishFinish with an existing Telegram result {id_token} or {auth} → saves the session — your key

── Sniper (auto-bid) ──

MethodEndpointDescription
POST/api/sniper/createArm an auto-bid {item, type, max_bid, trigger_seconds?, auto_pay?, webhook?} — your key
GET/api/sniper/listList YOUR sniper tasks — your key
POST/api/sniper/removeRemove task {id} — your key
POST/api/sniper/runRun the sniper now (cron runs it every minute) — your key

── Wallet / Auto-pay ──

MethodEndpointDescription
POST/api/wallet/setupStore 24-word seed {seed} OR register an external {address} (read-only) — protected by YOUR key
GET/api/walletPublic info: address, balance, seqno — your key (X-API-Key) or ?address=
DELETE/api/walletRemove YOUR wallet — your key
POST/api/wallet/paySign & send payment {to, amount_ton|amount_nano, payload?} — your key
POST/api/wallet/pay/txSign & send TonConnect messages {messages[]} or {transaction} — your key
GET/api/wallet/activityLast 20 wallet transactions
POST/api/tx/statusCheck a payment {hash} — your key

── Bulk actions ──

MethodEndpointDescription
POST/api/stars/bulkBuy Stars for many recipients {recipients[], quantity, auto_pay?}

── Search ──

MethodEndpointDescription
GET/api/searchBrowse marketplace (?type=usernames&sort=price_desc&filter=auction&q=)
POST/api/search/auctionsSearch auctions {query, type, offset_id}

── Auction ──

MethodEndpointDescription
POST/api/auction/stateGet auction state {type, username}
POST/api/auction/bidPlace bid {type, username, bid}
POST/api/auction/offer/initInit direct offer {type, username}
POST/api/auction/offer/confirmConfirm offer {id, amount}
POST/api/auction/sellStart auction {type, username, min_amount, max_amount?}
POST/api/auction/cancelCancel auction {type, username}
POST/api/auction/subscribeSubscribe to updates {type, username}
POST/api/auction/unsubscribeUnsubscribe {type, username}
POST/api/auction/can-sellCheck sell eligibility {type, username, auction}

── Stars ──

MethodEndpointDescription
POST/api/stars/stateInit Stars page {mode?, lv?, dh?}
POST/api/stars/pricesGet Stars prices {stars, quantity}
POST/api/stars/searchSearch recipient {query, quantity}
POST/api/stars/buyBuy Stars for user {recipient, quantity, show_sender?, auto_pay?}
POST/api/stars/buy-selfBuy Stars for yourself {quantity, auto_pay?}
POST/api/stars/repeatRepeat last Stars purchase

── Stars Giveaway ──

MethodEndpointDescription
POST/api/stars-giveaway/stateInit page
POST/api/stars-giveaway/pricesGet prices {stars, quantity}
POST/api/stars-giveaway/searchSearch recipient {query}
POST/api/stars-giveaway/createCreate giveaway {recipient, quantity, stars, days, auto_pay?}
POST/api/stars-giveaway/repeatRepeat last

── Premium ──

MethodEndpointDescription
POST/api/premium/stateInit Premium page
POST/api/premium/searchSearch recipient {query, months}
POST/api/premium/giftGift Premium {recipient, months: 3|6|12, auto_pay?}
POST/api/premium/repeatRepeat last

── Premium Giveaway ──

MethodEndpointDescription
POST/api/premium-giveaway/stateInit page
POST/api/premium-giveaway/pricesGet prices {quantity}
POST/api/premium-giveaway/searchSearch channel {query}
POST/api/premium-giveaway/createCreate giveaway {recipient, quantity, months, auto_pay?}
POST/api/premium-giveaway/repeatRepeat last

── Ads ──

MethodEndpointDescription
POST/api/ads/topup/stateInit topup page
POST/api/ads/topup/searchSearch account {query}
POST/api/ads/topupTopup someone {recipient, amount, auto_pay?}
POST/api/ads/rechargeRecharge own {recipient, amount, auto_pay?}
POST/api/ads/repeat-topupRepeat topup
POST/api/ads/repeat-rechargeRepeat recharge
POST/api/ads/revenue/stateInit withdrawal page
POST/api/ads/revenue/withdrawWithdraw revenue {amount, address}

── Gateway ──

MethodEndpointDescription
POST/api/gateway/stateInit page
POST/api/gateway/pricesGet prices {quantity}
POST/api/gateway/rechargeRecharge {quantity, auto_pay?}
POST/api/gateway/repeatRepeat last

── Assets ──

MethodEndpointDescription
POST/api/assetsList owned assets {type, offset_id?}
POST/api/assets/assignAssign username {type, username, assign_to}
POST/api/assets/bot-linkGet bot link {id}

── NFT ──

MethodEndpointDescription
POST/api/nft/convert/initStart conversion {username}
POST/api/nft/convert/checkCheck conversion {id}
POST/api/nft/convert/startFinalize conversion {id, bid, transaction}
POST/api/nft/convert/revertRevert conversion {username, confirmed}
POST/api/nft/transferTransfer NFT {username, recipient}
POST/api/nft/transfer/checkCheck transfer {id}
POST/api/nft/withdrawWithdraw to wallet {username, address}

── Random ──

MethodEndpointDescription
POST/api/random/stateInit page
POST/api/random/playPlay {amount, number}
POST/api/random/repeatRepeat last

── Login Codes ──

MethodEndpointDescription
POST/api/login-codes/stateGet state
POST/api/login-codes/toggleToggle codes {enabled}
POST/api/login-codes/terminateTerminate sessions {phone}

── KYC ──

MethodEndpointDescription
POST/api/kyc/tokenGet KYC token
POST/api/kyc/statusUpdate KYC status

── Fragment Wallet / Auth ──

MethodEndpointDescription
POST/api/auth/ton-linkGet TON auth link
POST/api/auth/ton-proofVerify wallet proof {account, device, proof}
POST/api/auth/ton-logoutDisconnect TON wallet
POST/api/wallet/verifyVerify wallet {address, proof}
POST/api/wallet/checkCheck wallet {address}
POST/api/wallet/linkLink wallet {address, proof}
POST/api/wallet/sessionsGet active sessions
POST/api/wallet/terminateTerminate session {session_id}
POST/api/auth/logoutFull logout

── History ──

MethodEndpointDescription
POST/api/history/bidsBids history
POST/api/history/premiumPremium history
POST/api/history/ordersOrders history
POST/api/history/ownersOwnership history

── Stars Revenue ──

MethodEndpointDescription
POST/api/stars-revenue/stateInit withdrawal page
POST/api/stars-revenue/withdrawWithdraw revenue {amount, address}

── Tonkeeper ──

MethodEndpointDescription
GET/api/tonkeeper/rawGet raw TX data (?id=req_xxx)
التوثيق النصي: /docs.txt · فحص الصحة: /health
⚠️ هذا المشروع مستقل وغير مرتبط بشركة Fragment أو Telegram
© 2026 3MH TECHNOLOGIES — جميع الحقوق محفوظة · v0.0.4