
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
@nimiq/core
Advanced tools
A very light Nimiq Proof-of-Stake client for browsers and NodeJS, compiled from Rust to WebAssembly.
Note This light client is intended to be used in web browsers or NodeJS only (no WASI support either). Other webworker-enabled environments are not yet supported.
You need to install this package from npm:
# Depending on your package manager:
npm install @nimiq/core
yarn add @nimiq/core
pnpm install @nimiq/core
This package contains the WASM file bundled for three targets: bundler
, web
and node
.
If you use any bundler for your project, like Webpack or Vite, you should probably use the bundler
target exported from the package root. If that doesn't work, or you require the web
target for your use-case, jump to the With ES Modules section.
For detailed installation instructions for your bundler/framework, refer to the Nimiq Developer Center.
// With Webpack: import the package asynchronously:
const Nimiq = await import('@nimiq/core');
// With Vite, import at the top of your file:
import * as Nimiq from '@nimiq/core';
// Create a configuration builder:
const config = new Nimiq.ClientConfiguration();
// Change the config, if necessary:
// --------------------------------
// Specify the network to use:
// Optional, default is 'mainalbatross'
config.network('testalbatross');
// Specify the seed nodes to initially connect to:
// Optional, default is the mainnet seed list
config.seedNodes(['/dns4/seed1.pos.nimiq-testnet.com/tcp/8443/wss']);
// Change the lowest log level that is output to the console:
// Optional, default is 'info'
config.logLevel('debug');
// Instantiate and launch the client:
const client = await Nimiq.Client.create(config.build());
// Import the loader and package from the /web path:
import init, * as Nimiq from '@nimiq/core/web';
// Load and initialize the WASM file
init().then(() => {
// Create a configuration builder:
const config = new Nimiq.ClientConfiguration();
// Change the config as shown above, if necessary
// ...
// Instantiate and launch the client:
const client = await Nimiq.Client.create(config.build());
});
For NodeJS, this package includes both CommonJS and ESM builds. You can either require()
the package or import
it.
// Import as CommonJS module
const Nimiq = require("@nimiq/core");
// Or import as ESM module
import * as Nimiq from "@nimiq/core";
// In ESM modules you can use await at the top-level and do not need an async wrapper function.
async function main() {
// Create a configuration builder:
const config = new Nimiq.ClientConfiguration();
// Change the config as shown above, if necessary
// ...
// Instantiate and launch the client:
const client = await Nimiq.Client.create(config.build());
}
main();
If you encounter issues or you find a bug, please open an issue in our Github at https://github.com/nimiq/core-rs-albatross.
If you want to provide feedback or have questions about the client, our "Nimiq Coders Dojo" Telegram group and the Community Forum are the right places for that.
FAQs
Nimiq's Rust-to-WASM web client
The npm package @nimiq/core receives a total of 296 weekly downloads. As such, @nimiq/core popularity was classified as not popular.
We found that @nimiq/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.