GrvtRawClient

Low-level client providing direct access to all GRVT API endpoints.

Constructor

new GrvtRawClient(options: GrvtRawClientOptions)

Options

Option
Type
Required
Default
Description

env

GrvtEnv

No

PROD

GRVT environment

apiKey

string

No

-

API key for authenticated endpoints

timeout

number | null

No

10000

Request timeout in ms

transport

IRequestTransport

No

-

Custom transport instance

Example

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

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

Properties

Property
Type
Description

transport

IRequestTransport

The transport used for API requests

env

GrvtEnv

The GRVT environment


Market Data Methods

These methods do not require authentication.

getInstrument

Get a single instrument by name.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

Returns: GetInstrumentResponse


getAllInstruments

Get all instruments.

Parameter
Type
Required
Description

is_active

boolean

No

Filter by active status

Returns: GetAllInstrumentsResponse


getFilteredInstruments

Get instruments with filters.

Parameter
Type
Required
Description

kind

Kind[]

No

Filter by instrument kind

base

Currency[]

No

Filter by base currency

quote

Currency[]

No

Filter by quote currency

is_active

boolean

No

Filter by active status

limit

number

No

Maximum results

Returns: GetFilteredInstrumentsResponse


getMiniTicker

Get mini ticker for an instrument.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

Returns: MiniTickerResponse


getTicker

Get full ticker for an instrument.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

Returns: TickerResponse


getOrderbookLevels

Get order book levels.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

depth

number

No

Orderbook depth (10, 50, 100, 500)

Returns: OrderbookLevelsResponse


getTrades

Get recent trades.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

limit

number

No

Maximum trades

Returns: TradeResponse


getTradeHistory

Get trade history with pagination.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

start_time

string

No

Start time in nanoseconds

end_time

string

No

End time in nanoseconds

limit

number

No

Maximum trades

cursor

string

No

Pagination cursor

Returns: TradeHistoryResponse with next cursor


getCandlestick

Get candlestick (OHLCV) data.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

interval

CandlestickInterval

Yes

Candle interval

type

CandlestickType

Yes

Price type (TRADE, MARK, INDEX, MID)

start_time

string

No

Start time in nanoseconds

end_time

string

No

End time in nanoseconds

limit

number

No

Maximum candles

cursor

string

No

Pagination cursor

Returns: CandlestickResponse


getFundingRate

Get funding rate history.

Parameter
Type
Required
Description

instrument

string

Yes

Instrument symbol

start_time

string

No

Start time in nanoseconds

end_time

string

No

End time in nanoseconds

limit

number

No

Maximum entries

cursor

string

No

Pagination cursor

Returns: FundingRateResponse


Trading Methods

These methods require authentication (apiKey).

createOrder

Create an order. Requires a pre-signed order payload.

Parameter
Type
Required
Description

order

SignedOrder

Yes

Signed order payload

Returns: CreateOrderResponse

circle-info

Use the [signing utilities](../utilities/signing.md) to create signed order payloads, or use `GrvtClient` which handles signing automatically.


cancelOrder

Cancel a single order.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

order_id

string

No

Order ID (either this or client_order_id)

client_order_id

string

No

Client order ID

Returns: AckResponse


cancelAllOrders

Cancel all orders.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

instrument

string

No

Filter by instrument

Returns: AckResponse


getOrder

Get an order by ID.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

order_id

string

No

Order ID

client_order_id

string

No

Client order ID

Returns: GetOrderResponse


getOpenOrders

Get open orders.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

kind

Kind[]

No

Filter by instrument kind

base

Currency[]

No

Filter by base currency

quote

Currency[]

No

Filter by quote currency

Returns: OpenOrdersResponse


getOrderHistory

Get order history with pagination.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

kind

Kind[]

No

Filter by instrument kind

base

Currency[]

No

Filter by base currency

quote

Currency[]

No

Filter by quote currency

limit

number

No

Maximum orders

cursor

string

No

Pagination cursor

Returns: OrderHistoryResponse with next cursor


getFillHistory

Get fill history with pagination.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

kind

Kind[]

No

Filter by instrument kind

base

Currency[]

No

Filter by base currency

quote

Currency[]

No

Filter by quote currency

start_time

string

No

Start time in nanoseconds

end_time

string

No

End time in nanoseconds

limit

number

No

Maximum fills

cursor

string

No

Pagination cursor

Returns: FillHistoryResponse with next cursor


getPositions

Get positions.

Parameter
Type
Required
Description

sub_account_id

string

Yes

Sub-account ID

kind

Kind[]

No

Filter by instrument kind

base

Currency[]

No

Filter by base currency

quote

Currency[]

No

Filter by quote currency

Returns: PositionsResponse


Account Methods

getSubAccountSummary

Get sub-account summary.

Returns: SubAccountSummaryResponse


getSubAccountHistory

Get sub-account history.

Returns: SubAccountHistoryResponse


getAggregatedAccountSummary

Get aggregated account summary across all sub-accounts.

Returns: AggregatedAccountSummaryResponse


getFundingAccountSummary

Get funding account summary.

Returns: FundingAccountSummaryResponse


Transfer Methods

deposit

Make a deposit from funding account to sub-account.

Returns: AckResponse


getDepositHistory

Get deposit history.

Returns: DepositHistoryResponse


transfer

Transfer between sub-accounts.

Returns: AckResponse


getTransferHistory

Get transfer history.

Returns: TransferHistoryResponse


withdrawal

Make a withdrawal.

Returns: AckResponse


getWithdrawalHistory

Get withdrawal history.

Returns: WithdrawalHistoryResponse

Last updated