Tree Shaking

The SDK supports tree shaking through modular exports. Import only what you need to minimize bundle size.

Export Paths

Path
Contents

@wezzcoetzee/grvt

Everything (main entry)

@wezzcoetzee/grvt/types

Enums and type definitions

@wezzcoetzee/grvt/config

Environment and endpoint configuration

@wezzcoetzee/grvt/transport

HTTP and WebSocket transports

@wezzcoetzee/grvt/signing

Order signing utilities

@wezzcoetzee/grvt/raw

GrvtRawClient

@wezzcoetzee/grvt/ccxt

GrvtClient (CCXT-style)

Import Examples

// Imports everything
import {
  GrvtClient,
  GrvtEnv,
  GrvtRawClient,
  HttpTransport,
  WebSocketTransport,
  // ... everything else
} from "@wezzcoetzee/grvt";

Common Patterns

Market Data Only (Smallest Bundle)

For read-only market data access:

Real-time Data Only

For WebSocket subscriptions without trading:

Trading (Full Feature)

For full trading functionality:

Custom Signing

For advanced signing workflows:

Deno Imports

For Deno, use the JSR registry:

Bundle Size Tips

  1. Import from specific paths rather than the main entry point

  2. Avoid importing types from main - use /types path

  3. Don't import signing utilities if you're only reading data

  4. Use GrvtRawClient if you don't need CCXT convenience methods

  5. Use HttpTransport directly for maximum control and smallest bundle

Last updated