SDK/ Response style
Response style
Default responseStyle: 'fields' returns an object with data, error, request, and response. Error handling is explicit; transport details stay inspectable.
If you prefer data-only and thrown errors, configure the client:
ts
const sdk = createClient({
apiKey: process.env.API_KEY!,
network: 'mainnet',
responseStyle: 'data',
throwOnError: true,
})You can also override per call by passing { throwOnError: true } as the second argument to any method:
ts
const { data: tx } = await sdk.transactions.get(
{ transactionId },
{ throwOnError: true },
)