Package Exports
- steam0-sdk
Readme
steam0-sdk
Top up a Steam balance with cryptocurrency from code or CLI. No auth, no API key, no KYC. Official client for steam0.shop β 0% markup. Pay in USDT (TRC-20 / ERC-20), Bitcoin (Lightning / Mainnet), TON, ETH, or LTC.
npm install steam0-sdkimport { Steam0Client } from 'steam0-sdk';
const order = await new Steam0Client().createOrder({
steamLogin: 'iliyafominator',
amountUsd: 25,
});
console.log('User pays here:', order.payUrl);That's it. The user opens payUrl, pays whatever crypto they want, Steam balance is topped up automatically within 1β5 minutes.
π€ For AI agents (Claude, GPT, Cursor, Cline, etc.)
This package is intentionally designed for autonomous use by LLM agents. No auth required, simple JSON contract, JSDoc on every method, deterministic order lifecycle.
Recipe β top up a Steam account from an agent in 3 steps:
// 1. Create the order. Returns immediately.
const order = await new Steam0Client().createOrder({
steamLogin: 'username_from_user',
amountUsd: 25,
});
// 2. Send order.payUrl to the user β they pay whatever crypto they have.
console.log(`Tell the user to pay here: ${order.payUrl}`);
// 3. (Optional) wait for fulfillment β useful for chatbots that need to confirm.
const final = await new Steam0Client().waitForOrder(order.id, {
onUpdate: (o) => console.log(`status: ${o.status}`),
});
console.log(final.status === 'completed' ? 'Done!' : `Issue: ${final.status}`);Exhaustive OrderStatus values: pending | paid | fulfilling | completed | failed | cancelled | expired | refund | unknown (terminal: completed/failed/cancelled/expired/refund).
Validation rules (server enforces, throws Steam0ApiError):
steamLoginmatches/^[a-zA-Z0-9_]{1,64}$/1 β€ amountUsd β€ 500_000
Need it from a non-Node language? Use the CLI (npx steam0-sdk create) or call the HTTP API directly β see Β«Without this SDKΒ» below.
Library usage
Create an order, redirect user to pay
const order = await s0.createOrder({
steamLogin: 'gamer123',
amountUsd: 50,
source: 'my-tg-bot', // optional β appears in the operator dashboard
});
// order.payUrl points to Heleket where the user picks BTC/USDT/etc and pays
console.log(order.id, order.payUrl, order.status);Wait for fulfillment
const final = await s0.waitForOrder(order.id, {
intervalMs: 3000,
onUpdate: (o) => console.log(o.status, o.batches?.completed, '/', o.batches?.total),
});
console.log(final.status); // 'completed' | 'failed' | 'cancelled' | 'expired' | 'refund'Just check status
const o = await s0.getOrder(orderId);Public crypto rates
const rates = await s0.getRates();CLI
The package ships a steam0 (and steam0-sdk) binary. No JS needed in your stack β shell out from any language.
# install globally
npm install -g steam0-sdk
steam0 create --login iliyafominator --amount 25
steam0 watch <order-id>
steam0 status <order-id>
steam0 ratesWithout install
npx steam0-sdk create -l iliyafominator -a 25Without this SDK (raw HTTP)
For Python, Go, Rust, shell scripts, etc β just hit the JSON API directly. No auth.
curl
# Create order
curl -X POST https://steam0.shop/api/agent/orders \
-H 'Content-Type: application/json' \
-d '{"steam_login":"iliyafominator","amount_usd":25}'
# Check status
curl https://steam0.shop/api/agent/orders/<ORDER_ID>Python
import requests, time
order = requests.post(
'https://steam0.shop/api/agent/orders',
json={'steam_login': 'iliyafominator', 'amount_usd': 25},
).json()
print('Pay here:', order['pay_url'])
# poll until terminal
terminal = {'completed', 'cancelled', 'failed', 'expired', 'refund'}
while True:
o = requests.get(f"https://steam0.shop/api/agent/orders/{order['id']}").json()
print(o['status'])
if o['status'] in terminal:
break
time.sleep(3)Go
resp, _ := http.Post(
"https://steam0.shop/api/agent/orders",
"application/json",
strings.NewReader(`{"steam_login":"iliyafominator","amount_usd":25}`),
)
var order map[string]any
json.NewDecoder(resp.Body).Decode(&order)
fmt.Println("Pay here:", order["pay_url"])API reference
new Steam0Client(opts?)
| option | type | required | default |
|---|---|---|---|
baseUrl |
string | no | https://steam0.shop |
timeoutMs |
number | no | 30000 |
source |
string | no | tag attached to all orders |
fetch |
function | no | globalThis.fetch |
createOrder({ steamLogin, amountUsd, source? }) β Order
Creates a new top-up order. Returns immediately with payUrl. Throws Steam0ApiError on validation failure.
getOrder(id) β Order
Returns the latest known state. Order.batches is present for orders that exceeded the per-batch cap (~$1000) β gives you live completed/total progress.
waitForOrder(id, opts) β Order
Polls until the order reaches a terminal status. Callback onUpdate fires on every poll β wire it to a progress bar.
getRates() β RatesResponse
Latest USD prices for supported cryptos.
ping() β boolean
Health check.
Errors
import { Steam0ApiError } from 'steam0-sdk';
try {
await s0.createOrder({ steamLogin: 'bad login!', amountUsd: 0.5 });
} catch (e) {
if (e instanceof Steam0ApiError) {
console.log(e.status, e.message); // 400, "amount must be between $1 and $500,000"
}
}Order lifecycle
pending β user opened pay page, hasn't paid yet (Heleket invoice TTL = 1h)
β
βΌ
paid β Heleket confirmed crypto received
β
βΌ
fulfilling β we're sending top-up requests to Giftery
β (large orders are split into batches; watch order.batches)
β
βββ completed β Steam balance updated, done
βββ failed β provider refused (e.g. unsupported region)
βββ unknown β provider call timed out, may have succeeded
βββ refund β needs manual refund (op handles via Heleket support)
βββ cancelled β user cancelled before payment cleared
βββ expired β pending > 2h, never paidSelf-hosting / staging
const s0 = new Steam0Client({
baseUrl: 'https://staging.steam0.shop',
});License
MIT