Clients

The SDK provides two client classes that wrap the transports with typed methods and convenience features.

Client Comparison

Feature

GrvtRawClient

GrvtClient

API Style

Low-level, direct

CCXT-compatible, high-level

Method Names

getOpenOrders

fetchOpenOrders

Order Signing

Manual

Automatic

Market Loading

Manual

Automatic validation

Best For

Custom implementations

Trading bots, familiar API

GrvtRawClient

Low-level client providing direct access to all GRVT API endpoints with typed requests and responses.

Initialization

import { GrvtEnv, GrvtRawClient } from "@wezzcoetzee/grvt";

const client = new GrvtRawClient({
  env: GrvtEnv.TESTNET,
  apiKey: "your-api-key", // Required for authenticated endpoints
});

Options

Option
Type
Default
Description

env

GrvtEnv

PROD

GRVT environment

apiKey

string

-

API key for authenticated requests

timeout

number | null

10000

Request timeout in ms

transport

IRequestTransport

-

Custom transport instance

Usage Example

Available Methods

See GrvtRawClient API Reference for the complete method list.

GrvtClient

High-level CCXT-style client with automatic market loading, order validation, and built-in signing.

Initialization

Options

Option
Type
Default
Description

env

GrvtEnv

PROD

GRVT environment

apiKey

string

-

API key for authenticated requests

tradingAccountId

string

-

Sub-account ID for trading

privateKey

string | AbstractWallet

-

Private key or wallet for signing

autoLoadMarkets

boolean

true

Auto-load markets on init

Market Loading

Markets must be loaded before placing orders. This fetches instrument data required for order signing:

Order Methods

Market Data Methods

Account Methods

Available Methods

See GrvtClient API Reference for the complete method list.

Custom Transport

Both clients accept a custom transport for advanced use cases:

Accessing the Raw Client

GrvtClient exposes its underlying GrvtRawClient:

Next Steps

Last updated