Skip to main content

Interface: GSwapOptions

gSwap SDK 2.0.0-rc.4


gSwap SDK 2.0.0-rc.4 / GSwapOptions

Interface: GSwapOptions

Defined in: packages/gswap-sdk/dist/index.d.ts:3326

Options for constructing a backend-routed SDK client.

Properties​

chainCallTimeoutMs?​

optional chainCallTimeoutMs?: number

Defined in: packages/gswap-sdk/dist/index.d.ts:3345

Request timeout in milliseconds (default 30 000); Infinity arms no timer.


dexBackendBaseUrl?​

optional dexBackendBaseUrl?: string

Defined in: packages/gswap-sdk/dist/index.d.ts:3341

Overrides the preset's swap backend base URL (a test or private deployment).


dexBackendWsUrl?​

optional dexBackendWsUrl?: string

Defined in: packages/gswap-sdk/dist/index.d.ts:3363

Realtime stream endpoint. Defaults to the environment's, or is derived from dexBackendBaseUrl.


env?​

optional env?: GSwapEnv

Defined in: packages/gswap-sdk/dist/index.d.ts:3339

'stage' or 'prod' swap backend preset; defaults to 'prod'.


httpRequestor?​

optional httpRequestor?: HttpRequestor

Defined in: packages/gswap-sdk/dist/index.d.ts:3343

HTTP transport for every request; defaults to the global fetch.


onInvalidEntry?​

optional onInvalidEntry?: InvalidEntryHandler

Defined in: packages/gswap-sdk/dist/index.d.ts:3361

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?​

optional signer?: GalaChainSigner

Defined in: packages/gswap-sdk/dist/index.d.ts:3328

Signs every write. Without one, reads work and any write throws NO_SIGNER.


streamApiKey?​

optional streamApiKey?: string

Defined in: packages/gswap-sdk/dist/index.d.ts:3370

x-api-key for the privileged stream view; server-side only, and it requires webSocketImpl (see GdexStreamConfig.apiKey).


symbolResolution?​

optional symbolResolution?: "registry" | "canonical"

Defined in: packages/gswap-sdk/dist/index.d.ts:3355

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?​

optional uniqueKeyPrefix?: string

Defined in: packages/gswap-sdk/dist/index.d.ts:3375

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?​

optional walletAddress?: string

Defined in: packages/gswap-sdk/dist/index.d.ts:3337

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?​

optional webSocketImpl?: unknown

Defined in: packages/gswap-sdk/dist/index.d.ts:3365

WebSocket constructor for the realtime stream; required on Node.js older than 22.


wire?​

optional wire?: WireOptions

Defined in: packages/gswap-sdk/dist/index.d.ts:3347

Query encoding and User-Agent of the read requests (see WireOptions).