fragment-api
v1.0.3
Published
βοΈ NodeJS API client wrapper for Fragment, purchase of Telegram Stars & Premium π
Readme
π Info
fragment-api is a simple NodeJS API client wrapper for Fragment, which uses fragment-api.net under the hood. It supports:
πΈ Purchase Telegram Stars & Premium
β Works with or without KYC
π Bypass Fragment purchase limits
π End-to-end encryption supported
π§© No API key or registration required
π No need to use the TON API directly
π¦ Built-in request models for clean integration
π Supports multi-order transactions
π§ Lightweight & developer-friendly
π Requirements (without KYC)
β TON Wallet v4r2 πͺ
β TON Wallet should be Active (send any transaction from it) πͺ
π Requirements (with KYC)
β Fragment account with linked TON wallet and Telegram account π
β KYC verification on Fragment π
β Export cookies from Fragment πͺ (as Header String using Cookie Editor extension)
β Installation
npm i fragment-apiβοΈ Usage examples
import FragmentAPIClient from "fragment-api";
// Replace with your 24 words seed phrase from TON v4r2 Wallet
const seed = "your_24_words_seed_phrase";
// Replace with your Fragment cookies exported from Cookie-Editor extension as Header String
// https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm
const fragmentCookies = "your_fragment_cookies";
const fragment = new FragmentAPIClient();
async function main() {
try {
// Ping
const ping = await fragment.ping();
console.log("API ping:", ping);
// Get balance
const balance = await fragment.getBalance(seed);
console.log("Balance:", balance);
// Get user info
const userInfo = await fragment.getUserInfo("Night", fragmentCookies);
console.log("User info:", userInfo);
// Buy stars without KYC
const starsNoKYC = await fragment.buyStarsWithoutKYC("Night", 100, seed);
console.log("Buy stars without KYC response:", starsNoKYC);
// Buy stars
const stars = await fragment.buyStars("Night", 100, false, fragmentCookies, seed);
console.log("Buy stars response:", stars);
// Buy Telegram Premium without KYC
const premiumNoKYC = await fragment.buyPremiumWithoutKYC("Night", 3, seed);
console.log("Buy Telegram Premium without KYC response:", premiumNoKYC);
// Buy Telegram Premium
const premium = await fragment.buyPremium("Night", 3, false, fragmentCookies, seed);
console.log("Buy Telegram Premium response:", premium);
// Get orders
const orders = await fragment.getOrders(seed, 10, 0);
console.log("Orders:", orders);
} catch (error) {
console.error("Error:", error);
}
}
main();π Like it? Star it!
Please rate this repository by giving it a star rating in the top right corner of the GitHub page (you must be logged in to your account). Thank you β€οΈ

π License
This repository is licensed under Apache Licence 2.0.
Made with β€οΈ by NightStrang6r
