Models & types
@stridge/sdk ships from a single subpath (.), so every public type and value is reachable through one import. The barrel is small and intentional — if a type appears in this list it's part of the contract; nothing else is.
import {
// builder
createApiClient,
type CreateApiClientOptions,
type ApiClient,
// errors
BackendError,
// low-level HTTP
HttpClient,
type HttpClientOptions,
type RequestOptions,
// environments
API_HTTP_PROD,
API_HTTP_DEV,
getBaseUrl,
// shared helpers
routing,
type EndpointCallOptions,
type AbsoluteUrl,
type Env,
// models — pick the import style that fits
models, // namespaced — models.Gateway.GatewayUdaDto
endpoints, // namespaced — endpoints.Gateway.Client (type only)
type GatewayUdaDto, // also re-exported bare via `export *`
} from "@stridge/sdk"The package is published with "sideEffects": false, so unused imports are tree-shaken — there's no cost to importing whatever you need.
Import patterns
Models can be reached two ways:
// 1) Namespaced — useful when you handle multiple domains and want a clear prefix.
import { models } from "@stridge/sdk"
type Uda = models.Gateway.GatewayUdaDto
type Quote = models.Uda.QuoteResponse
type Balance = models.Balance.OnchainBalanceResponse
// 2) Bare — useful when you need just one or two types.
import type { GatewayUdaDto, QuoteResponse, OnchainBalanceResponse } from "@stridge/sdk"Both styles resolve to the same types — the namespaced form just groups them. Pick the style that matches your call site; mixing in one file is fine.
For exhaustive narrowing, every DTO ships with full JSDoc on every field, so jumping to the .d.ts in your editor (or node_modules/@stridge/sdk/dist/esm/index.d.ts) is the fastest way to see the entire surface.
Builder & client
| Export | Kind | Notes |
|---|---|---|
createApiClient | function | The single entry point. See API client. |
CreateApiClientOptions | interface | projectKey, env, baseUrl, defaultHeaders. |
ApiClient | interface | The returned shape: two HttpClients + three namespaced endpoint clients + the resolved baseUrl. |
Errors
| Export | Kind | Notes |
|---|---|---|
BackendError | class | Canonical error type. statusCode, optional cause, static BackendError.from(unknown, fallbackMessage?). See Errors & retries. |
HTTP plumbing
| Export | Kind | Notes |
|---|---|---|
HttpClient | class | The transport the namespaced clients use. Exposed so callers can hit arbitrary paths. |
HttpClientOptions | interface | projectKey, baseUrl, defaultHeaders. |
RequestOptions | interface | Per-call: headers, query (null/undefined-dropping), plus standard fetch RequestInit fields. |
EndpointCallOptions | interface | signal?: AbortSignal — accepted by every namespaced endpoint method. |
Environment helpers
| Export | Kind | Notes |
|---|---|---|
API_HTTP_PROD | const | "https://api.stridge.com/v1" |
API_HTTP_DEV | const | "https://api.stridge.dev/v1" |
getBaseUrl | function | (env: Env) => AbsoluteUrl — same resolution createApiClient uses internally. |
Env | type | "prod" | "dev". |
AbsoluteUrl | type | `https://${string}` | `http://${string}`. |
Routing table
| Export | Kind | Notes |
|---|---|---|
routing | const | The full route map. Mirrors every gateway path the SDK calls; the namespaced clients are 1:1 with this object. |
import { routing } from "@stridge/sdk"
routing.uda.supportedAssets // "/uda/supported-assets"
routing.uda.quote // "/uda/quote"
routing.gateway.start // "/gateway/start"
routing.gateway.assets // "/gateway/assets"
routing.gateway.poll.template // "/gateway/[owner]"
routing.gateway.poll.generate({ owner: walletAddress })
// → "/gateway/0x..."
routing.gateway.rateBySymbol.generate({ asset_symbol: "USDC" })
routing.gateway.rateByErc20.generate({ chain: "9001", contract_address: "0xaf88..." })
routing.balance.onchain.generate({ wallet_address: walletAddress })Parameterized routes (gateway.poll, gateway.rateBySymbol, gateway.rateByErc20, balance.onchain) expose both a template string and a generate(params) builder; non-parameterized routes are bare strings. The builder URL-encodes every value — pass the raw wallet address or symbol, don't pre-encode.
Gateway
Everything under models.Gateway (also re-exported bare). Used by gateway.start, gateway.poll, gateway.assets, and the rate endpoints.
Requests
| Type | Used by |
|---|---|
StartGatewayRequest | gateway.start(payload) |
StartDestinationRequest | nested in StartGatewayRequest.destination |
Responses
| Type | Used by |
|---|---|
GatewayStartResponse | gateway.start return — UDA id, destination, deposit addresses, status, metadata. |
GatewayPollResponse | gateway.poll return — owner, filter echo, udas[], optional pagination. |
RateResponse | gateway.rateBySymbol, gateway.rateByErc20 returns — amount / unit_price / total. |
Entities
| Type | Notes |
|---|---|
GatewayUdaDto | One UDA on the owner. Status enum at GatewayUdaDto.Status (idle → from_detected → from_confirmed → routing → to_pending → to_funded → completed / failed). |
GatewaySettlementDto | One matched deposit + settlement pair. Status enum at GatewaySettlementDto.Status (created → routing → completed / failed). |
DepositAddressDto | Per-chain deposit address provisioned for the UDA, with accepted_assets[]. |
DepositAssetDto | One accepted asset on a deposit address (address, decimals, symbol). |
DestinationDto | Resolved destination metadata for a UDA. |
GatewayFilterDto | Echoed destination-tuple filter on gateway.poll responses. |
GatewayLegFromDto | Deposit leg — source tx, sender, raw / human / USD amounts. |
GatewayLegToDto | Settlement leg — recipient, destination tx, settled_at. |
GatewayFeesDto | Settlement fees with provider / platform / total breakdown. |
GatewayRouteDto | Provider + scenario + ETA. Scenario enum at GatewayRouteDto.Scenario. |
GatewayEventDto | Settlement lifecycle event. Type enum at GatewayEventDto.Type. |
GatewayExecutionMetadataDto | Provider-execution snapshot (LiFi / Relay tx hashes, sub-status). |
GatewayExecutionDestinationDto | Destination-leg detail nested in execution metadata. |
GatewayOnChainVerificationDto | Gateway's own destination-tx verification. |
For the full UDA polling flow that uses most of these, see Gateway endpoints — gateway.poll.
UDA
Everything under models.Uda. Used by uda.supportedAssets and uda.quote.
Responses
| Type | Used by |
|---|---|
SupportedAssetsResponse | uda.supportedAssets and gateway.assets returns. |
QuoteResponse | uda.quote return — from, to, fees, route, exchange_rate, expires_at. |
QuoteErrorResponse | Typed narrowing of ErrorResponse for quote failures. |
QuoteErrorCode | Open string union — "upstream_unavailable" | "route_unavailable" | "unsupported_asset" | "amount_too_low" | "amount_too_high" | "quote_expired" | "internal_error" | (string & {}). |
isQuoteErrorResponse(value): value is QuoteErrorResponse — type guard for narrowing BackendError.cause on quote calls.
Entities
| Type | Notes |
|---|---|
SupportedAssetDto | One chain entry in the catalogue. chain_type is widenable: "EVM" | "TVM" | (string & {}). |
AssetDto | One token contract on a chain. Optional min_deposit_usd, price_impact. |
NativeCurrencyDto | One chain's native currency. Optional min_deposit_usd, price_impact. |
QuoteSideDto | Source or destination side of a quote — network_id, asset_address, amount. |
QuoteFeesDto | Aggregated quote fee with optional gas_fee / protocol_fee split. |
QuoteRouteDto | Routing context — provider, scenario, optional estimated_time_seconds. |
ChainType | The widenable union backing SupportedAssetDto.chain_type. |
Balance
Everything under models.Balance. Used by balance.onchain.
| Type | Notes |
|---|---|
OnchainBalanceResponse | balance.onchain return — wallet_address, fetched_at, total_usd, chains[]. |
OnchainChainDto | One chain's slice of the wallet — native + tokens, subtotal_usd. |
OnchainTokenDto | One token entry — symbol, raw_amount, amount, amount_usd, is_native, is_spam. |
Common
Cross-cutting envelopes.
| Type | Notes |
|---|---|
OkResponse<T> | Success envelope { success: true, data: T, message?: string }. Discriminated union with ErrorResponse on success. The SDK already unwraps data for you on the typed endpoint methods — OkResponse<T> is only relevant when calling httpClient directly. |
ErrorResponse | Error envelope { success: false, code: number, error: string }. Surfaces inside BackendError.cause on JSON-bodied failures. |
Pagination | { count, limit, offset }. Optional on GatewayPollResponse; reserved for future server-side pagination. |
Endpoint client classes (type-only)
The endpoint clients themselves are also exported through the endpoints namespace — useful when you want to type a dependency injection seam.
import { endpoints } from "@stridge/sdk"
interface Repo {
gateway: endpoints.Gateway.Client
uda: endpoints.Uda.Client
balance: endpoints.Balance.Client
}The runtime values are also there (endpoints.Gateway.Client is a class you could new directly with an HttpClient), but the canonical path is to instantiate them through createApiClient — bypassing the builder skips reserved-header sanitization and the shared baseUrl plumbing.
Where field-level docs live
Every interface and field above carries JSDoc on the source. The fastest path to the full reference for any DTO is:
- In your editor: jump to definition (
gd/F12) on the type name. - On disk: open
node_modules/@stridge/sdk/dist/esm/index.d.ts. The file is one barrel re-export; every interface lands a few clicks away through the IDE. - In source (if vendored):
kit/packages/sdk/src/models/{Gateway,Uda,Balance,Common}/.
Related
- API client —
createApiClient,ApiClient,HttpClient. - Gateway endpoints — methods that consume the Gateway models.
- UDA endpoints —
QuoteResponse,isQuoteErrorResponse,SupportedAssetDto. - Balance endpoint —
OnchainBalanceResponseand its filters. - Errors & retries — the
BackendErrorfield reference.