Skip to main content

index/interfaces/WireOptions.md

How the SDK writes a read request on the wire. The defaults suit a server-side caller; an app that already issues the same requests from its own HTTP stack (a web app, the Gala Wallet) sets these so the SDK's requests are indistinguishable from the ones it replaces.

One object, carried by ChainGateway, so every service built on a gateway (symbols, pools, positions, quoting) shares it without per-service plumbing.

Properties​

PropertyTypeDescription
headers?Record<string, string>Extra request headers for every read, sent after (and so able to replace) the defaults above; for example axios' Accept: application/json, text/plain, */*, so a request is the same as the one an app's own HTTP stack used to send.
queryEncoding?"standard" | "readable"Query-string encoding of GET parameters. - 'standard' (default): URLSearchParams (application/x-www-form-urlencoded), where $ and | become %24 and %7C. - 'readable': keeps $ | : , and the RFC 3986 sub-delimiters ! ' ( ) * unescaped, so a composite key such as GALA$Unit$none$none or client|abc reads as written. Everything that would change a query's meaning (& = # % +, space, non-ASCII, controls) is still percent-encoded (a space is +), so the server decodes exactly the value that was passed. This is the text a hand-written formatUrl helper produces for every value it can represent.
userAgent?string | falseThe User-Agent request header. Defaults to GalaChain-SDK/<version>; false omits it (browsers forbid setting it, and an app whose own requests carry none can match them). Content-Type is only ever sent with a request body, never on a GET.