Configuration
Everything TriaClient accepts, plus the environment knob that selects which Tria builder fees route to.
TriaClientConfig
type TriaClientConfig = {
network?: 'mainnet' | 'staging' // DEPRECATED — use `development`.
development?: boolean // true → Tria's dev builder/treasury (still mainnet). Default false.
hl?: HlConfig
decibel?: DecibelConfig
}
type HlConfig = {
agentPrivateKey: string // 0x + 64 hex (secp256k1)
accountAddress: string // 0x + 40 hex (EVM)
}
type DecibelConfig = {
delegatePrivateKey?: string // 0x + 64 hex (Ed25519) or AIP-80. OMIT for read-only.
aptosOwnerAddress?: string // master Aptos wallet — SDK derives the primary subaccount
subaccountAddress?: string // DEPRECATED: legacy fallback; must match the derived primary
nodeApiKey?: string // Geomi Api key for reads (required when decibel is set)
gasStation?: string // Geomi Gs key for sponsored writes
}
- Both
hlanddecibelare independently optional. A client built with onlyhlworks for HL; calling a Decibel method throwsTriaError(INVALID_ARGUMENT). - Agent / delegate keys accept any common format: raw
0x…hex, AIP-80ed25519-priv-0x…, or unprefixed hex. Aptos addresses can be AIP-40 short or long; the SDK canonicalizes to long internally. - Builder addresses + fee values are hardcoded per network and are not user-configurable. See Errors & attribution.
Read-only Decibel client
delegatePrivateKey is optional. A decibel block with just { nodeApiKey } serves public market data (markets, ticker, orderbook, candles, recentTrades) with no trading credentials. Add aptosOwnerAddress to also read private account state (positions, balances, account, openOrders, fills).
// Public market data only — no trading credentials.
const md = new TriaClient({
decibel: { nodeApiKey: process.env.TRIA_TRADE_DECIBEL_NODE_API_KEY! },
})
await md.ticker({ venue: 'decibel', market: 'BTC/USD' })
Calling a trading method on a read-only client throws TriaError(CONFIG) with a clear pointer to add delegatePrivateKey.
Builder environment
Both venues always trade on real mainnet markets. The only knob is which Tria builder/treasury the fees route to:
- Name
(default)- Type
- production
- Description
Leave
developmentunset / false. This is what external operators use.
- Name
development: true- Type
- env TRIA_TRADE_DEVELOPMENT=true
- Description
Tria's development builder/treasury — internal integration testing against real venues. Fees route to a separate treasury.
There is no testnet target — development does not change the venue, only the builder address.
The old network: "staging" did the same thing but its name wrongly implied a
test venue. It still works (maps to development: true), but prefer
development. network: "mainnet" (or omitting it) is production.
Environment variables
The canonical TRIA_TRADE_* registry, shared by the SDK, the MCP server, the provisioning wizard, and the in-app export — so the same .env works everywhere.
| Variable | For | Notes |
|---|---|---|
TRIA_TRADE_NETWORK | both | mainnet (default). staging is a deprecated alias for TRIA_TRADE_DEVELOPMENT=true. |
TRIA_TRADE_DEVELOPMENT | both | true → dev builder. |
TRIA_TRADE_HL_AGENT_KEY | HL | scoped agent key (not your main wallet key). |
TRIA_TRADE_HL_ACCOUNT_ADDRESS | HL | HL master EVM address. |
TRIA_TRADE_DECIBEL_DELEGATE_KEY | Decibel | scoped Ed25519 delegate key. |
TRIA_TRADE_DECIBEL_APTOS_OWNER_ADDRESS | Decibel | master Aptos address (SDK derives the subaccount). |
TRIA_TRADE_DECIBEL_NODE_API_KEY | Decibel | Geomi Api key — required for reads. |
TRIA_TRADE_DECIBEL_GAS_STATION_KEY | optional | Geomi Gs key — sponsored writes. |
TRIA_TRADE_CLIENT_ID | optional | Telemetry attribution identity. Omit → anonymous. |
TRIA_TRADE_TELEMETRY | optional | 0 to opt out of usage telemetry (default on). |
TRIA_TRADE_TELEMETRY_ENDPOINT | optional | Override the telemetry proxy URL. |
See Telemetry & privacy for what's collected and how to opt out.