MyStars FaaS
Official SDKs
Typed client libraries for the MyStars Fulfilment API — quote a price, check a recipient, create an order, and pay on-chain in TON or USDT. The SDKs are non-custodial: MyStars never holds your keys.
Looking for endpoints and schemas? See the full interactive API reference. API keys are issued in @my_stars_tg_bot → API access, and sent on every request as the X-Api-Key header.
TypeScript / JavaScript
Runs anywhere modern JS does — Node, Deno, Bun, Cloudflare Workers, edge runtimes, and the browser. Three packages:
@mystars-tg/faas-sdk— the core client: HTTP with retries + idempotency, typed errors, pagination, order tracking, webhook verification, and non-custodial payment builders. Zero crypto dependencies; safe in the browser.@mystars-tg/faas-wallet— an opt-in, self-custody TON wallet (Node only). Sign and broadcast a payment from a wallet you control — the key stays in your own process and never reaches MyStars.@mystars-tg/faas-cli— themystars-faascommand-line tool for pricing, orders, watching, and offline webhook verification.
Install
npm install @mystars-tg/faas-sdk
Quickstart
import { MyStarsClient, buildPaymentRequest } from "@mystars-tg/faas-sdk";
const client = MyStarsClient.production(process.env.MYSTARS_API_KEY!);
// 1. Quote the all-in price (pay in TON or USDT).
const quote = await client.getPricing({
type: "stars",
quantity: 100,
payment_currency: "ton",
});
// 2. Confirm the recipient can receive it — before charging anyone.
const check = await client.checkRecipient({
type: "stars",
recipient: { username: "durov" },
});
if (!check.eligible) throw new Error(check.reason);
// 3. Create the order (use a STABLE idempotencyKey = your own order id).
const order = await client.createOrder(
{
type: "stars",
recipient: { username: "durov" },
quantity: 100,
payment_currency: "ton",
},
{ idempotencyKey: `order-${myOrderId}` },
);
// 4. Pay it — non-custodial: your keys never leave your process.
const pay = buildPaymentRequest(order.payment);
console.log(pay.tonDeeplink); // ton://transfer/… — open in any TON walletnpm: faas-sdk · faas-wallet · faas-cli · GitHub
Python
mystars-faas ships sync and async clients, exact-Decimal money, typed errors, automatic retries + idempotency, webhook verification, and dependency-free on-chain payment builders. Requires Python ≥ 3.9; the only runtime dependency is httpx.
Install
pip install mystars-faas
Quickstart
import os
from mystars_faas import MyStarsClient, build_payment_request
client = MyStarsClient.production(os.environ["MYSTARS_API_KEY"])
# 1. Quote the all-in price (pay in TON or USDT).
quote = client.get_pricing(type="stars", quantity=100, payment_currency="ton")
# 2. Confirm the recipient can receive it — before charging anyone.
check = client.check_recipient("durov", type="stars")
if not check.eligible:
raise SystemExit(check.telegram_message)
# 3. Create the order (an Idempotency-Key is generated and reused on retry).
order = client.create_order(type="stars", recipient="durov", quantity=100)
# 4. Pay it — non-custodial: your keys never leave your process.
req = build_payment_request(order.payment)
print(req.ton_deeplink) # ton://transfer/… — open in any TON walletComing soon
PHP and Go SDKs are on the roadmap. Until then, every endpoint is documented in the API reference and is a plain HTTPS call with the X-Api-Key header, so any language works today.