> ## 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.

# Connectors

> Default and lazy connectors, per-chain entry points, Google login with Privy, and WalletConnect.

A connector knows how to find, connect and restore wallets of one family (EVM, NEAR, Solana, ...). The kit takes a
list of connector **factories**: `(kit) => Promise<OmniConnector>`.

## Default connectors

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

new HotKit({ connectors: defaultConnectors });
```

`defaultConnectors` has EVM, NEAR, Solana, TON, Stellar, TRON, Sui, Aptos, Starknet, XRP and UTXO. Each one is a
`lazyConnector`: its module and chain SDK are imported only

* at startup, when the storage has a session for it (so the wallet is restored after a reload), or inside the HOT app;
* otherwise when something needs the list of wallets: `kit.connect()`, `kit.openProfile()`, `kit.openBridge()` or
  `kit.requestConnectors()`.

So an app that never opens the connect popup does not download any chain SDK.

## Picking chains

Build your own list from the per-chain entry points. Every entry point's default export is a factory creator:

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

const connectors = [
  lazyConnector("evm", () => import("@hot-labs/kit/evm"), (m) => m.default()),
  lazyConnector("solana", () => import("@hot-labs/kit/solana"), (m) => m.default()),
  lazyConnector("near", () => import("@hot-labs/kit/near"), (m) => m.default()),
];

new HotKit({ connectors });
```

`load` must be a literal `() => import("...")` so your bundler emits a separate chunk. Pass `{ eager: true }` as the
fourth argument to load a connector at startup.

Eager (not lazy) registration also works, at the cost of a bigger first bundle:

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

new HotKit({ connectors: [evm(), cosmos({ chainId: "cosmoshub-4" })] });
```

| Entry point | Factory | Wallets |
| - | - | - |
| `@hot-labs/kit/evm` | `evm()` | Injected (EIP-6963) wallets, WalletConnect |
| `@hot-labs/kit/near` | `near(base?)` | Wallets of `@hot-labs/near-connect` |
| `@hot-labs/kit/solana` | `solana()` | Wallet Standard wallets (Phantom, Solflare, ...) |
| `@hot-labs/kit/ton` | `ton(options?)` | TonConnect wallets |
| `@hot-labs/kit/stellar` | `stellar()` | Freighter and other Stellar wallets |
| `@hot-labs/kit/tron` | `tron()` | TronLink, WalletConnect |
| `@hot-labs/kit/cosmos` | `cosmos({ chainId? })` | Keplr |
| `@hot-labs/kit/sui` | `sui()` | Sui Wallet Standard (Slush, Suiet, Phantom, OKX, ...) |
| `@hot-labs/kit/aptos` | `aptos()` | AIP-62 wallets (Petra, Nightly, OKX, Pontem, ...) |
| `@hot-labs/kit/starknet` | `starknet()` | Ready (Argent X), Braavos |
| `@hot-labs/kit/xrp` | `xrp()` | GemWallet |
| `@hot-labs/kit/utxo` | `utxo()` | BTC, LTC, DOGE, BCH, DASH, ZEC wallets |
| `@hot-labs/kit/privy` | `privy({ appId, clientId?, redirectUrl? })` | Google login with embedded wallets |

> [!NOTE]
>
> Wallets of Sui, Aptos, Starknet, XRP and UTXO chains have no intents account (`omniAddress` is `""`): they can send
> on-chain transfers and deposits but cannot sign intents.

## Google login (Privy)

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

const connectors = [
  ...defaultConnectors,
  lazyConnector("privy", () => import("@hot-labs/kit/privy"), (m) => m.default({ appId: "<privy app id>" })),
];
```

One Google account gives an embedded wallet per chain: EVM and Solana are Privy wallets, NEAR, Stellar and TON are
signed by Privy's TEE wallets. Login opens a popup; `redirectUrl` (default: the page origin) must be an allowed redirect
URL of your Privy app.

## WalletConnect

EVM and TRON can connect mobile wallets over WalletConnect. Set `walletConnect.projectId` (from
[dashboard.reown.com](https://dashboard.reown.com)) and `walletConnect.metadata` in `HotKitOptions`; without a project id
these options are not shown.

## Inside the HOT Wallet

When the app runs inside the HOT Wallet (Telegram mini app or in-app browser) the wallet is injected and every lazy
connector loads at startup, so the user is connected without a picker.


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