Interface: GSwapOptions
Options for constructing a backend-routed SDK client.
Properties
| Property | Type | Description |
|---|---|---|
chainCallTimeoutMs? | number | Request timeout in milliseconds (default 30 000); Infinity arms no timer. |
dexBackendBaseUrl? | string | Overrides the preset's swap backend base URL (a test or private deployment). |
dexBackendWsUrl? | string | Realtime stream endpoint. Defaults to the environment's, or is derived from dexBackendBaseUrl. |
env? | GSwapEnv | 'stage' or 'prod' swap backend preset; defaults to 'prod'. |
httpRequestor? | HttpRequestor | HTTP transport for every request; defaults to the global fetch. |
onInvalidEntry? | InvalidEntryHandler | Told about every row of a pool, symbol, position, price, price-series, season or leaderboard answer that was skipped as unusable (see InvalidEntryHandler); without it such rows are skipped silently. |
signer? | GalaChainSigner | Signs every write. Without one, reads work and any write throws NO_SIGNER. |
streamApiKey? | string | x-api-key for the privileged stream view; server-side only, and it requires webSocketImpl (see GdexStreamConfig.apiKey). |
symbolResolution? | "registry" | "canonical" | How tokens are turned into trading symbols. 'registry' (default) reads the symbol registry once (GET /v2/trade/symbols, cached) and accepts symbols or class keys. 'canonical' makes no registry request: the caller passes the backend's canonical trading symbols (from a quote, an estimate or a position), reads send tokens and ticks exactly as given (composite keys included) and the backend orients the pair; see CanonicalSymbols. |
uniqueKeyPrefix? | string | Prefix of every write's uniqueKey (<prefix><uuid>). Defaults to galaswap-operation-, what the Gala Wallet and the gSwap web app send; the backend does not depend on it. |
walletAddress? | string | The selected account, sent as X-Wallet-Address on writes (attribution only; the chain recovers the signer from the signature). Required for shadow writes. Any spelling of an Ethereum account (eth|<40 hex> in any casing, 0x..., bare hex) is sent as eth|<EIP-55>, client|<id> as written; a mixed-case spelling that is not the checksum is refused at construction (INVALID_WALLET_ADDRESS), and eth|0x... (not an address form) is refused as core's INVALID_ETH_USER_REF_PREFIX. |
webSocketImpl? | unknown | WebSocket constructor for the realtime stream; required on Node.js older than 22. |
wire? | WireOptions | Query encoding and User-Agent of the read requests (see WireOptions). |
chain call timeout ms dex backend base url ws swap env http requestor on invalid entry handler gala signer no stream api key web socket impl gdex config symbol resolution unique prefix wallet address eth user ref wire options