Legacy gRPC API v1beta7
Versioned gRPC reference for existing Omniston v1beta7 integrations.
This reference uses the v1beta7 TON address model (blockchain: 607) and referral fees in basis points.
This guide describes how to use the Omniston swap functionality over the gRPC API from a trader's perspective. It parallels the legacy WebSocket reference but shows the gRPC specifics.
Key Differences from WebSocket API
Protocol Field For the gRPC API, the
protocolfield in each swap chunk must be a string:"StonFiV1","StonFiV2","DeDust", or"TonCo". In contrast, the WebSocket API uses numeric codes1,2,3, or4.
Extra Version Currently, only
extraVersion = 1is supported.Steps vs. Chunks\
Each SwapStep moves from one asset to another (e.g., TON → USDC).\
Each step can have multiple SwapChunk objects, but on TON you typically see exactly one chunk per step.
Method Names In the gRPC API, traders use similar calls to
requestForQuote,buildTransfer,trackTrade, etc., but these are exposed via protobuf messages, not JSON-RPC. The underlying fields are the same.
gRPC Endpoints (TLS)
Production: omni-grpc.ston.fi:443 Sandbox: omni-grpc-sandbox.ston.fi:443
⚠️ gRPC endpoints are host:port targets over TLS and are not HTTP REST URLs. Do not use
https://...as if it were a REST API.
Typical Flow (Traders)
A typical gRPC-based swap flow from a trader's viewpoint is:
Send a Quote Request Using
Omniston.requestForQuote(or the corresponding gRPC call), providing:bidAssetAddress,askAssetAddressThe desired
amount(eitherbidUnitsoraskUnits)Optional
referrerAddressandreferrerFeeBpssettlementMethods=[SETTLEMENT_METHOD_SWAP]if you want a swap\settlementParamssuch asmaxPriceSlippageBps,maxOutgoingMessages(for TON), orflexibleReferrerFeeflag
You receive an Observable (RxJS style in the SDK) or a stream of
QuoteResponseEventmessages over gRPC:First, you'll receive a
QuoteRequestAckmessage containing therfq_id(a SHA-256 hex string) that uniquely identifies your quote requestThen, the server may update your quote repeatedly if a more favorable price arrives
Build the Transfer When you have a valid
Quote, callOmniston.buildTransferwith:The
quoteyou acceptedYour
sourceAddress(onbidBlockchain)Your
destinationAddress(onaskBlockchain)Optional:
refundAddress- where funds should be returned if the transaction fails (defaults to sender's wallet) The API returns an object with blockchain-specific transaction data (for TON, a list of messages).
Sign/Send the Transaction\
On TON, you typically pass these messages to your wallet (e.g., TonConnect, Tonkeeper, etc.).
Wait for the transaction to be mined.
Track the Trade You can then call
Omniston.trackTradeto receive streaming updates about the trade status. This includes whether the trade was filled, partially filled, or aborted.
Important Data Types
BlockchainA numeric code following SLIP-0044. For TON, this is607.
TON address model: This reference identifies TON with
blockchain: 607. API v1beta8 uses named chain branches in asset and address objects; see Supported chains and assets.
AddressAn object:ProtocolMust be one of:"StonFiV1""StonFiV2""DeDust""TonCo"
SettlementMethodFor now, typically[0]for swap in numerical form, or (in your SDK)SettlementMethod.SETTLEMENT_METHOD_SWAP.QuoteRequestAckAcknowledgment message sent immediately after receiving a quote request:SwapStepandSwapChunk\Each step is a transition from
bidAssetAddresstoaskAssetAddress.For TON: typically exactly one chunk per step.
A chunk includes:
QuoteThe server provides aquoteId,bidUnits,askUnits,quoteTimestamp,tradeStartDeadline, etc. Includesparamswith settlement info for the chosen method (SwapSettlementParams).
Rejected Quotes
If you pass extraVersion != 1 (e.g., 3), the quote or the route gets rejected with a message like:
Make sure to use extraVersion = 1.
Last updated