Documentation Index
Fetch the complete documentation index at: https://toncenter.ness.su/llms.txt
Use this file to discover all available pages before exploring further.
Client
Pass these parameters when creatingToncenterRestClient:
| Parameter | Default | Description |
|---|---|---|
api_key | Optional | API key or list of keys for rotation. |
network | Mainnet | Mainnet or Testnet. |
base_url | Optional | Custom base URL (overrides network selection). |
timeout | 10 seconds | Request timeout. |
session | Optional | External HTTP session to share across clients. |
headers | Optional | Extra HTTP headers sent with every request. |
cookies | Optional | Extra cookies sent with every request. |
rps_limit | Optional | Client-side rate limit (requests per second). |
rps_period | Optional | Rate-limiter window in seconds. |
retry_policy | Enabled | Retry policy. Disable by passing None. |
Without an API key the SDK auto-limits to 1 RPS / 1.2 s on the client side to match the server-side throttle. With a key, client-side limiting is off unless set explicitly.
Session
- Context manager
- Manual
- External
Retries
Rate-limited (429) and server-error responses are retried automatically with exponential backoff.
| Status codes | Max retries | Base delay | Max delay | Backoff |
|---|---|---|---|---|
| 429 | 5 | 0.3 s | 3 s | 2x |
| 500, 502, 503, 504 | 3 | 0.5 s | 5 s | 2x |
| Field | Default | Description |
|---|---|---|
statuses | Required | HTTP status codes that trigger retry. |
max_retries | 3 | Maximum retry attempts. |
base_delay | 1 second | Initial delay. |
max_delay | 30 seconds | Upper bound after backoff. |
backoff_factor | 2.0 | Multiplier per attempt. |
RetryRule. The SDK’s built-in policy uses tuned values shown in the table above.
Pass
retry_policy=None to disable retries entirely.Key Rotation
Pass a list ofApiKey objects to rotate between keys on rate-limit errors (429). Each key carries its own client-side rate limit.
ApiKey also works — rate limit is taken from the object instead of the constructor rps_limit parameter:
429, the SDK exhausts all retry attempts for the current key (with backoff), then rotates to the next key and retries with a fresh cycle. Each key uses its own RateLimiter.