QubicTypeScript

Getting started

Create a wallet, build a transfer, and send it in a few lines.

Import the wallet and a client

import { createWallet, generateSeed } from "@qubic.org/wallet"
import { toIdentity } from "@qubic.org/types"

Create a wallet from a new seed

const seed   = generateSeed()       // random 55-char Seed
const wallet = createWallet(seed)

console.log("Identity:", wallet.identity)   // the 60-char public address
console.log("Public key:", wallet.publicKey) // Uint8Array (32 bytes)

Build and sign a transfer

const destination = toIdentity("CFBMEMZOIDEXQAUXYYSZIURADQLAPWPMNJXQSNVQZAHYVOPYUKKJBJUCTVJL")

const { encoded, hash } = await wallet.buildTransfer({
  destination,
  amount: 1_000_000n,
  targetTick: 18500000,  // use live.getTickInfo() for the real tick
  currentTick: 18499995,
})

console.log("TX hash:", hash)
console.log("Encoded:", encoded)
// Pass `encoded` to live.broadcastTransaction(encoded) from @qubic.org/rpc

generateSeed produces a cryptographically random seed. Store it securely — anyone with the seed controls the wallet. If you need to store multiple seeds safely, use the Vault API with a user password.