Module: Hyperliquid

Defined in:
lib/hyperliquid.rb,
lib/hyperliquid/info.rb,
lib/hyperliquid/cloid.rb,
lib/hyperliquid/client.rb,
lib/hyperliquid/errors.rb,
lib/hyperliquid/version.rb,
lib/hyperliquid/exchange.rb,
lib/hyperliquid/constants.rb,
lib/hyperliquid/ws/client.rb,
lib/hyperliquid/signing/eip712.rb,
lib/hyperliquid/signing/signer.rb

Overview

Ruby SDK for Hyperliquid API Provides access to Hyperliquid’s decentralized exchange API including both read (Info) and write (Exchange) operations

Defined Under Namespace

Modules: Constants, Signing, WS Classes: AuthenticationError, BadRequestError, Client, ClientError, Cloid, Error, Exchange, Info, NetworkError, NotFoundError, RateLimitError, SDK, ServerError, TimeoutError, WebSocketError

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.new(testnet: false, timeout: Constants::DEFAULT_TIMEOUT, retry_enabled: false, private_key: nil, expires_after: nil) ⇒ Hyperliquid::SDK

Create a new SDK instance

Parameters:

  • testnet (Boolean) (defaults to: false)

    Whether to use testnet (default: false for mainnet)

  • timeout (Integer) (defaults to: Constants::DEFAULT_TIMEOUT)

    Request timeout in seconds (default: 30)

  • retry_enabled (Boolean) (defaults to: false)

    Whether to enable retry logic (default: false)

  • private_key (String, nil) (defaults to: nil)

    Ethereum private key for exchange operations (optional)

  • expires_after (Integer, nil) (defaults to: nil)

    Global order expiration timestamp in ms (optional)

Returns:



25
26
27
28
29
30
31
32
33
34
# File 'lib/hyperliquid.rb', line 25

def self.new(testnet: false, timeout: Constants::DEFAULT_TIMEOUT, retry_enabled: false,
             private_key: nil, expires_after: nil)
  SDK.new(
    testnet: testnet,
    timeout: timeout,
    retry_enabled: retry_enabled,
    private_key: private_key,
    expires_after: expires_after
  )
end