Nimiq

API Reference

API reference for the Nimiq Web Client (@nimiq/core) — classes, interfaces, enumerations, and type aliases grouped by domain.

Full reference for the @nimiq/core package. The entries below are auto-generated from the TypeScript definitions.

Client and Configuration

The main entry points for connecting to the network and configuring the client.

ClassDescription
ClientCore class — connect to the network, query state, send transactions, subscribe to events.
ClientConfigurationBuilder for configuring network, sync mode, peers, and logging before creating a client.
PolicyProtocol constants — epoch length, batch size, staking parameters, supply calculations.

Accounts and Addresses

Working with on-chain accounts and Nimiq addresses.

Class / TypeDescription
AddressCreate, parse, format, and compare Nimiq addresses.
PlainBasicAccountShape of a basic account returned by getAccount().
PlainStakingContractShape of the staking contract account.
PlainVestingContractShape of a vesting contract account.
PlainHtlcContractShape of an HTLC (hashed time-locked contract) account.
AccountTypeEnum of account types: basic, vesting, HTLC, staking.
PlainAccountUnion type of all plain account shapes.

Transactions

Building, signing, and inspecting transactions.

Class / TypeDescription
TransactionBuilderStatic methods for creating all transaction types — basic transfers, staking, vesting, HTLCs.
TransactionTransaction object — sign, serialize, verify, and inspect.
PlainTransactionShape of a serialized transaction.
PlainTransactionDetailsTransaction with inclusion state, block hash, and confirmations.
PlainTransactionReceiptLightweight receipt (transaction hash + block height).
TransactionFlagTransaction flags (contract creation, signaling).
TransactionFormatTransaction format (basic, extended).
TransactionStateTransaction lifecycle states (pending, included, etc.).

Transaction Data and Proofs

Typed data and proof structures attached to transactions.

TypeDescription
PlainRawDataRaw transaction data payload.
PlainAddStakeDataData for add-stake transactions.
PlainCreateStakerDataData for create-staker transactions.
PlainCreateValidatorDataData for create-validator transactions.
PlainUpdateStakerDataData for update-staker transactions.
PlainUpdateValidatorDataData for update-validator transactions.
PlainRetireStakeDataData for retire-stake transactions.
PlainSetActiveStakeDataData for set-active-stake transactions.
PlainVestingDataData for vesting contract creation.
PlainHtlcDataData for HTLC creation.
PlainRawProofRaw transaction proof.
PlainStandardProofStandard signature proof.
PlainHtlcRegularTransferProofHTLC regular transfer proof (with pre-image).
PlainHtlcEarlyResolveProofHTLC early resolve proof.
PlainHtlcTimeoutResolveProofHTLC timeout resolve proof.
PlainTransactionProofUnion type of all proof shapes.
PlainTransactionRecipientDataUnion type of all recipient data shapes.
PlainTransactionSenderDataUnion type of all sender data shapes.

Blocks

Block structures returned by the client.

TypeDescription
PlainMicroBlockShape of a micro block (produced by validators each slot).
PlainMacroBlockShape of a macro block (election and checkpoint blocks).
PlainBlockCommonFieldsFields shared by both block types.
PlainBlockUnion type of micro and macro blocks.

Keys and Cryptography

Key generation, signing, and cryptographic primitives.

ClassDescription
KeyPairGenerate, derive, sign, and serialize Ed25519 keypairs.
PrivateKeyPrivate key generation and serialization.
PublicKeyPublic key derivation, verification, and serialization.
SignatureEd25519 signature.
SignatureProofSignature proof construction for transactions.
ES256PublicKeyES256 (P-256) public key — used for WebAuthn integration.
ES256SignatureES256 (P-256) signature.
BLSKeyPairBLS keypair — used for validator voting keys.
BLSPublicKeyBLS public key.
BLSSecretKeyBLS secret key.
HashHashing utilities (Blake2b, SHA-256).
CryptoUtilsShared cryptographic helpers.
MerkleTreeMerkle tree construction and proof verification.
CommitmentSchnorr commitment for multi-signature schemes.
CommitmentPairCommitment pair (secret + commitment).
PartialSignaturePartial signature for multi-signature aggregation.
RandomSecretRandom secret for commitment schemes.
SecretBase class for cryptographic secrets.

Wallets and HD Derivation

Mnemonic phrases, entropy, and hierarchical deterministic key derivation.

ClassDescription
MnemonicUtilsGenerate mnemonics, convert to keys/seeds, detect mnemonic type (BIP39 vs legacy).
ExtendedPrivateKeyHD key derivation — master key generation, child derivation, path-based derivation.
EntropyEntropy generation and conversion for mnemonic phrases.

Staking

Validator and staker data structures.

TypeDescription
PlainValidatorShape of a validator returned by getValidator().
PlainValidatorDataValidator configuration fields.
PlainStakerShape of a staker returned by getStaker().
StakingContractStaking contract parsing utilities.

Contracts

Vesting and HTLC contract helpers.

ClassDescription
VestingContractParse vesting contract data from transactions.
HashedTimeLockedContractParse HTLC data and proofs from transactions.

Utilities

Serialization, formatting, and buffer helpers.

ClassDescription
SerialBufferBinary serialization buffer for reading and writing typed data.
BufferUtilsConvert between hex, base64, and byte arrays.
NumberUtilsNumber formatting and parsing.
StringUtilsString utilities.
ArrayUtilsArray comparison and manipulation.

Network and Peers

TypeDescription
PlainPeerInfoShape of peer information from peer-change events.
ConsensusStateConsensus state values (connecting, syncing, established).
PlainServiceNetwork service flags.

Initialization

TypeDescription
defaultThe init() function for web target — loads the WASM module.
initSyncSynchronous WASM initialization (when async is not available).
InitInputAccepted input types for async init().
SyncInitInputAccepted input types for initSync().
InitOutputOutput of WASM initialization.
PlainClientConfigurationShape of the built client configuration object.
Copyright © 2026