getTime
POST
https://triport.io/rpc/tonReturns the current Unix time reported by the selected TON liteserver.
TON mainnetton:rpcfree+; ton_read_rpc: 15 / 20 / 100 / 250 RPS (free / basic / pro / business; default, unmeasured)
getTime returns the current time reported by the selected liteserver. The
result is a Unix timestamp in the now field and represents that server's
clock at the time of the response.
Use it for liteserver diagnostics or coarse clock comparison. It is not a TON
block position and must not replace masterchain seqno or transaction logical
time (lt) when ordering chain data.
This direct liteserver method has no separate HTTP-gateway compatibility promise. The Triport JSON-RPC facade calls the ADNL liteserver pool.
Parameters
JSON-RPC params is an empty by-name object.
Params: object (by-name).
——optionalThis method has no parameters; send
params: {}.Response
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC protocol version. |
id | number or string | Correlates the response with the request. |
result | object | Liteserver time result. |
result.now | integer | Unix timestamp reported by the selected liteserver. |
The response is copied from the accepted live fixture.
Errors
See TON errors for the shared envelope.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | The parameter structure is malformed or positional. |
-32601 | Method not found | The method is outside the published read-only catalog. |
401 | Unauthorized | The API key is missing or invalid. |
429 | Rate limited | The ton_read_rpc budget is exceeded. |
Examples
const response = await fetch("https://triport.io/rpc/ton", {
method: "POST",
headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ jsonrpc: "2.0", id: "clock", method: "getTime", params: {} }),
});
const { result: serverTime } = await response.json();Notes
nowis diagnostic server time, not consensus time, blockseqno, or transactionlt.- Calls use named params. When batched, correlate results by JSON-RPC
id. - Poll this method if needed; TON WebSocket subscriptions are not published. Public HTTP gateways are not used as upstreams.
- Related methods:
getVersionandgetMasterchainInfo.