Skip to content

Api¤

hl.Api ¤

Api(
    *,
    info: Info,
    exchange: Exchange,
    ws: Ws,
    universe: Universe,
    account: Account | None = None,
)

The Api class provides access to the info, exchange, and ws endpoints.

Warning: Do not instantiate Api directly. Use Api.create instead.

Attributes:

Name Type Description
info Info

The info endpoint.

exchange Exchange

The exchange endpoint.

ws Ws

The websocket endpoint.

universe Universe

The universe of assets available on the exchange.

account Account | None

The account to use for authentication.

Methods:

Name Description
create

Create an Api instance.

account property writable ¤

account: Account | None

The account to use for authentication.

exchange instance-attribute ¤

exchange = exchange

info instance-attribute ¤

info = info

universe property writable ¤

universe: Universe

The universe of assets available on the exchange.

ws instance-attribute ¤

ws = ws

create async classmethod ¤

create(
    *,
    account: Account | None = None,
    network: Network = MAINNET,
) -> Api

Create an Api instance.

Parameters:

Name Type Description Default
account Account

The account to use for authentication.

None
network Network

The network to use. Defaults to MAINNET.

MAINNET

Returns:

Type Description
Api

The Api instance.