QubicTypeScript

Installation

Install the packages you need. Everything is independently installable.

The SDK is split into focused packages. Install only what your project needs.

The SDK is built for Bun. All packages work with Node.js ≥ 18 as well — swap bun add for npm install or pnpm add.


Packages

PackageWhat it does
@qubic.org/typesBranded primitives, protocol constants, shared errors
@qubic.org/cryptoK12, SchnorrQ signatures, FourQ key derivation
@qubic.org/txTransaction builder, signer, encoder
@qubic.org/walletWallet, encrypted vault, seed utilities
@qubic.org/rpcType-safe HTTP client for the Qubic RPC gateway
@qubic.org/bobLive node client — JSON-RPC, REST, WebSocket subscriptions
@qubic.org/eventsBinary event decoder and typed subscription helpers
@qubic.org/tcpLow-level TCP connection to Qubic nodes
@qubic.org/registryVersioned ABI registry and binary payload codec
@qubic.org/contractsGenerated typed wrappers for every deployed contract
@qubic.org/reactReact hooks and wallet connectors for dApps

Common setups

Send a transfer or call a contract

bun add @qubic.org/wallet @qubic.org/rpc

Build a dApp with React

bun add @qubic.org/react @qubic.org/contracts

Work with raw cryptography

bun add @qubic.org/crypto @qubic.org/types

Full SDK

bun add @qubic.org/types @qubic.org/crypto @qubic.org/tx @qubic.org/wallet @qubic.org/rpc @qubic.org/contracts @qubic.org/react

TypeScript configuration

The SDK targets ES2020. Your tsconfig.json should include:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }
}

If you're using Node.js with moduleResolution: "node16" or "nodenext", the packages ship dual CJS/ESM builds and resolve correctly in both modes.


Bun vs Node.js

All packages work in both runtimes. The main difference:

  • Bunbun add, bun run, no extra config needed. Environment variables are loaded automatically.
  • Node.jsnpm install / pnpm add, standard tsconfig.json. The crypto module works the same way in both.

There is no browser-specific build required. The packages use standard Web APIs (fetch, WebSocket, crypto.subtle) and work in modern browsers, Bun, and Node.js.

On this page