# @hot-labs/omni-sdk

> A fast and cheap bridge protocol over HOT Protocol that uses the NEAR Intents engine for exchange

Latest version **2.25.5** (published 2026-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hot-labs/omni-sdk
pnpm add @hot-labs/omni-sdk
yarn add @hot-labs/omni-sdk
bun add @hot-labs/omni-sdk
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.25.5 |
| Published | 2026-04-30 |
| First published | 2025-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 14 |
| Unpacked size | 561.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | HOT Labs |
| Maintainers | hot-labs |

## Links

- npm: https://www.npmjs.com/package/@hot-labs/omni-sdk
- npm.io page: https://npm.io/package/@hot-labs/omni-sdk

## Dependencies (14)

- [rlp](https://npm.io/package/rlp.md) 3.0.0
- [ethers](https://npm.io/package/ethers.md) 6.15.0
- [@ton/ton](https://npm.io/package/@ton/ton.md) 15.2.1
- [@ton/core](https://npm.io/package/@ton/core.md) 0.62.0
- [@scure/base](https://npm.io/package/@scure/base.md) 2.0.0
- [@ton/crypto](https://npm.io/package/@ton/crypto.md) 3.3.0
- [@near-js/types](https://npm.io/package/@near-js/types.md) 2.2.5
- [@near-js/utils](https://npm.io/package/@near-js/utils.md) 2.2.5
- [@near-js/crypto](https://npm.io/package/@near-js/crypto.md) 2.2.5
- [@ton-api/client](https://npm.io/package/@ton-api/client.md) 0.4.0
- [@near-js/providers](https://npm.io/package/@near-js/providers.md) 2.2.5
- [@stellar/stellar-sdk](https://npm.io/package/@stellar/stellar-sdk.md) 14.1.1
- [@ton-api/ton-adapter](https://npm.io/package/@ton-api/ton-adapter.md) 0.4.1
- [@near-js/transactions](https://npm.io/package/@near-js/transactions.md) 2.2.5

## Recent versions

- 2.25.5 (latest) — 2026-04-30
- 2.22.0-beta.5 (beta) — 2025-11-25
- 2.20.0-alpha.2 (alpha) — 2025-08-22
- 2.25.4 — 2026-04-30
- 2.25.3 — 2026-04-20
- 2.25.2 — 2026-04-01
- 2.25.1 — 2026-03-12
- 2.25.0 — 2026-03-11
- 2.24.8 — 2026-02-21
- 2.24.7 — 2026-01-21
- 2.24.6 — 2025-12-15
- 2.24.5 — 2025-12-12
- 2.24.4 — 2025-12-12
- 2.24.3 — 2025-12-10
- 2.24.2 — 2025-12-10
- … 73 more at https://npm.io/package/@hot-labs/omni-sdk/versions

## README

# HotBridge

A fast and cheap bridge protocol over **HOT Protocol** that uses the **NEAR Intents** engine for exchange.<br/>
**Available for EVM (10+ chains), NEAR, Solana, TON, Stellar**

`yarn add @hot-labs/omni-sdk`

<br />

## Demo UI

Deploy: [https://hot-dao.github.io/omni-sdk](https://hot-dao.github.io/omni-sdk/)

**Covered cases:**

- Connect NEAR, EVM _(currently deposit only to Intent account binded to NEAR wallet)_
- Deposit token widget (from NEAR, EVM)
- Withdraw token widget (to NEAR, EVM)
- Find pending withdrawals and finish them
- View HOT Bridge tokens balances on Intents

## Setup HotBridge

```ts
const omni = new OmniBridge({
  apiKey: "optional",
  logger: console, // optional

  tonRpc: env.TON_API_KEY, // only if use TON
  evmRpc: { 56: ["rpc"] }, // only if use EVM
  solanaRpc: ["rpc"], // only if use SOLANA

  // Relayer for execute intents and omni bridge operations
  executeNearTransaction: async ({ receiverId, actions }) => {
    const hash = await relayer.signAndSendTransaction({ receiverId, actions }).
    return { sender: relayer.accountId, hash };
  },
});

```

### Deposit to HotBridge

```ts
const intentAccount = "account";
const hash = await omni.ton.deposit({
  token: "native",
  amount: 100000000n,
  sendTransaction: async (tx) => "hash", // execute by payer
  sender: "address", // payer account
  intentAccount, // intent account to deposit
});

// usually from 30 seconds to 2 minutes, but can wait indefinitely
const abortController = new AbortController(); // optional argument
const pending = await omni.waitPendingDeposit(Network.Ton, hash, intentAccount, abortController.signal);
await omni.finishDeposit(pending);
```

### Withdraw from HotBridge

```ts
// Only intent signer need for withdraw
const { nonce } = await omni.withdrawToken({
  signIntents: async (intents) => signedIntent, // sign by intent account with omni balance
  intentAccount: "account",
  chain: Network.Base,
  receiver: "0x...", // any onchain receiver
  token, // onchain address of token to withdraw
  gasless: true,
  amount: 10n,
  ...signer,
});

// gasless withdraw
if (nonce == null) return;

const withdraw = await omni.getPendingWithdraw(nonce);
await omni.evm.withdraw({
  sendTransaction: async () => "hash", // any tx executor for claim tokens for receiver
  sender: "address", // any tx executor address
  ...withdraw,
});
```

## Finish pending withdraw

```ts
// Get all uncompleted withdrawals for this bnb address
const pendings = await omni.getPendingWithdrawalsWithStatus(56, "0xAddress");

// Clear completed withdrawals
const completed = pendings.filter((t) => t.completed);
if (completed.length) await omni.clearPendingWithdrawals(completed);

// Finish all
const uncompleted = pendings.filter((t) => !t.completed);
for (const pending of uncompleted) {
  await omni.evm.withdraw({ ...pending, ...signer }); // push tx
}
```

## Processing pending withdrawals on the fly

```ts
const execute = async (pending: WithdrawArgsWithPending): Promise<string | null> => {
  try {
    // If the pending withdrawal is less than 5 minutes old, do not try to withdraw again
    if (Date.now() / 1000 - pending.timestamp < 5 * 60) return null;

    // Trying to withdraw TON
    if (pending.chain === Network.Ton || pending.chain === Network.OmniTon) {
      return await bridge.ton.withdraw({ sendTransaction, refundAddress: "address", ...pending });
    }

    // Trying to withdraw Stellar
    if (pending.chain === Network.Stellar) {
      return await bridge.stellar.withdraw({ sender: "address", sendTransaction, ...pending });
    }

    // Trying to withdraw Solana
    if (pending.chain === Network.Solana) {
      const solana = await bridge.solana();
      return await solana.withdraw({ sender: "address", sendTransaction, ...pending });
    }

    return await bridge.evm.withdraw({ sendTransaction, ...pending });
  } catch (error) {
    console.error(error);
    return null;
  }
};

const abortController = new AbortController();
bridge.iterateWithdrawals({ signal: abortController.signal, execute });
```

---
_Source: https://npm.io/package/@hot-labs/omni-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
