> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hex-api.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Every HotKit option, custom RPCs per chain, storage, and every endpoint the kit uses by default.

All options of `new HotKit(options)` (`HotKitOptions`). All are optional; the kit needs no API key.

```ts theme={null}
import { HotKit, IndexedDBStorage } from "@hot-labs/kit";
import { defaultConnectors } from "@hot-labs/kit/defaults";

const kit = new HotKit({
  connectors: defaultConnectors,
  rpc: { 8453: "https://base-mainnet.g.alchemy.com/v2/<key>" },
  storage: new IndexedDBStorage(),
  ui: { presentation: "modal", loadFont: true },
});
```

| Option | Type | Default | Purpose |
| - | - | - | - |
| `connectors` | `ConnectorFactory[]` | `defaultConnectors` | Which wallets the user can connect. See [Connectors](https://docs.hex-api.app/kit/connectors.md). |
| `walletConnect` | `{ projectId, metadata }` | none | WalletConnect (Reown) project for mobile wallets. Without `projectId` the WalletConnect options are hidden. |
| `rpc` | `RpcOverrides` | see [Endpoints](#endpoints) | Your RPC endpoints per chain. See [Custom RPCs](#custom-rpcs). |
| `storage` | `DataStorage` | `LocalStorage` | Where sessions and settings are kept. See [Storage](#storage). |
| `ui` | `KitUIOptions` | sheet, no theme | Popup presentation, theme, font, extra profile tabs. See [UI](https://docs.hex-api.app/kit/ui.md). |
| `branding` | `KitBranding` | Omni chain name and icon | Name and icon of the balance account in the UI. |
| `balanceAccount` | `KitBalanceAccount` | HOT balance of the priority wallet | Which balance deposits go to, reserved amounts. See [Balance account](https://docs.hex-api.app/kit/ui.md#balance-account). |
| `chains` | `ChainRecord<ChainConfig>` | none | Extra chain configs (registered for every kit in the process). |
| `oneClick` | `{ baseUrl?, userBaseUrl?, managerPublicKey? }` | hex-api's 1Click proxy | 1Click swap API. `baseUrl` defaults to `https://hex-api.app/market/v1/1click` (HEX's partner key, added server side). To use your own partner key, point it at your server-side proxy; never ship the key to the browser. |
| `marketRelay` | `string` | `https://hex-api.app/market` | Prices, trending tokens and token lists. |
| `indexer` | `{ baseUrl?, balances?, client? }` | none | Balance indexer, opt-in. `balances: "proxy"` reads on-chain balances through `baseUrl` (hex-api: `https://hex-api.app/wallet`) first; or pass your own `BalanceIndexer`. |
| `clock` | `() => number` | `Date.now` | Time source for intent deadlines (e.g. a server-synced clock). |
| `openExternal` | `(url: string) => void` | `window.open(url, "_blank")` | How the UI opens explorer links and wallet deeplinks (for webviews and mini apps). |

## Custom RPCs

`rpc` takes your endpoints per chain, in failover order. They **replace** the defaults of that chain (list a default
after yours if you want it as a fallback); chains you leave out keep their defaults. An endpoint is a URL or
`{ url, headers }`, and its headers are sent to that endpoint only, so a provider key never reaches another node.

```ts theme={null}
import { Network } from "@hot-labs/kit";

new HotKit({
  rpc: {
    1: "https://eth-mainnet.g.alchemy.com/v2/<key>",
    8453: ["https://base.my-node.example", "https://mainnet.base.org"],
    [Network.Solana]: { url: "https://mainnet.helius-rpc.com/?api-key=<key>" },
    [Network.Near]: { url: "https://rpc.mainnet.fastnear.com", headers: { Authorization: "Bearer <key>" } },
    [Network.Ton]: { url: "https://tonapi.io", headers: { Authorization: "Bearer <key>" } },
    "stellar:horizon": "https://horizon.my-node.example",
  },
});
```

What the URL is for each chain:

| Key | Endpoint |
| - | - |
| EVM chain id (`1`, `8453`, ...) | JSON-RPC |
| `Network.Near`, `Network.Solana`, `Network.Starknet`, `Network.Xrp` | JSON-RPC |
| `Network.Gonka` (Cosmos) | Tendermint RPC (the first one is used) |
| `Network.Stellar` / `"stellar:horizon"` | Soroban RPC / Horizon |
| `Network.Ton` | A tonapi-compatible API (the first one is used) |
| `Network.Tron` | A TronGrid-compatible full node API (WalletConnect TRON wallets; TronLink uses its own node) |
| `Network.Aptos` | The Aptos REST API (`.../v1`, the first one is used) |
| `Network.Sui` / `"sui:grpc"` | Sui GraphQL / a full node's gRPC-web |
| `Network.Btc`, `Network.Litecoin`, `Network.Doge`, `Network.Bch`, `Network.Dash`, `Network.Zcash` | An Esplora-compatible API (`https://mempool.space/api`) for balances and fee rates |
| `Network.Hyperliquid` | The HyperCore API (`https://api.hyperliquid.xyz`) |

The overrides are process-wide (`rpcEndpoints` in `@hot-labs/kit/core`). Read the effective list with
`rpcEndpoints.get(chain)`.

## Storage

The kit keeps wallet sessions (`kit:<connector id>` keys), the last bridge pair, activity and similar state in a
`DataStorage`:

```ts theme={null}
interface DataStorage {
  get(key: string): Promise<string | null>;
  set(key: string, value: string): Promise<void>;
  remove(key: string): Promise<void>;
}
```

Built in:

* `LocalStorage` (default): `window.localStorage`.
* `IndexedDBStorage`: IndexedDB, for larger state.
* `ParentStorage`: the storage of a parent window (the app runs in an iframe of the HOT Wallet). Fail-closed: calls
  throw `StorageUnavailableError` until the parent answered.

> [!WARNING]
>
> Some values are sensitive: a HotCraft trading key is stored in plain text. Pass a storage that encrypts or scopes the
> data if that matters for your app. The 1Click refresh token is kept in `sessionStorage`, its access token in memory.

## Endpoints

Every endpoint the kit uses by default. The only backend is hex-api (`hex-api.app`); nothing goes to HOT Wallet's
backend, and no request carries a key of yours unless you put one in `rpc`.

| Chain / service | Default | Override |
| - | - | - |
| EVM chains | hex-api's RPC `https://hex-api.app/wallet/v1/rpc/<chain>` (keyless), then the chain's public RPCs | `rpc[chainId]` |
| Solana | hex-api's Solana RPC `https://hex-api.app/wallet/v1/solana/rpc` (transaction calls), then publicnode, Helium, Solana Vibe Station, mainnet-beta | `rpc[Network.Solana]` |
| NEAR | Public RPCs (`relmn.aurora.dev`, `archival-rpc.mainnet.near.org`, `rpc-near.hapi.mobi`, `nearrpc.aurora.dev`) | `rpc[Network.Near]` |
| Stellar | `mainnet.sorobanrpc.com`, Horizon `horizon.stellar.org` | `rpc[Network.Stellar]`, `rpc["stellar:horizon"]` |
| TON | `https://tonapi.io` without a key | `rpc[Network.Ton]` or `configureTonApi({ apiKey, baseUrl, concurrency })` |
| TRON | TronGrid | `rpc[Network.Tron]` |
| Cosmos (Gonka) | `node1` / `node2.gonka.ai`, `gonka04.6block.com` (`/chain-rpc`) | `rpc[Network.Gonka]` |
| Sui, Aptos, Starknet, XRP | Public keyless nodes (Mysten, Aptos Labs, publicnode / zan / onfinality, xrplcluster) | `rpc[...]` |
| UTXO | mempool.space, blockstream, litecoinspace, BlockCypher, Haskoin, Insight, Blockchair, Ledger | `rpc[...]` (Esplora) |
| Hyperliquid | `api.hyperliquid.xyz` | `rpc[Network.Hyperliquid]` |
| Token balances | The chain's RPC, token by token over the kit's token list | `indexer: { baseUrl, balances: "proxy" }` or your own `BalanceIndexer` |
| Prices, token lists | `https://hex-api.app/market` | `marketRelay` |
| Swaps (1Click) | hex-api's 1Click proxy `https://hex-api.app/market/v1/1click` | `oneClick.baseUrl` (your proxy) |
| Intents relay, bridge | `https://mpc.hex-api.app` | none |

> [!TIP]
>
> For production traffic on TON, pass your own tonapi key: the keyless tier is rate limited.

## Process-wide settings

`api`, `rpcEndpoints`, `tokens`, `chains` and the 1Click client are module-level singletons shared by every `HotKit` in the
same JavaScript realm. Each `new HotKit()` overwrites, when given, the `rpc` overrides it names and the `oneClick`,
`marketRelay` and `openExternal` settings; `chains` passed to one kit are registered for all. The UI defaults
(`ui.presentation`, `ui.theme`) are process-wide too. Create one kit per app.

## Version

```ts theme={null}
import { KIT_VERSION } from "@hot-labs/kit";
kit.version === KIT_VERSION; // "2.0.0"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.