Packages
Use this page when you know the package name and need its public subpaths, PKG.new install link, and first import.
All packages are ESM-only. Install packages from PKG.new, and include peer dependencies from the table when you use a subpath that needs them.
Package map
| Package | Use when | Do not use for | Peer dependencies |
|---|---|---|---|
@onmax/nimiq-mini-app-kit | Browser mini-app provider access, Ethereum discovery, simulator tooling, Nuxt sidecar | Server-side Nimiq RPC reads | nuxt, vue |
@onmax/better-auth-nimiq | Same-device Nimiq wallet sign-in for Better Auth | QR or second-device approval | better-auth, optional nuxt, vue |
@onmax/better-auth-cross-device | Better Auth order lifecycle for login, sign, and transaction handoff | Nimiq proof verification by itself | better-auth |
@onmax/cross-device-nimiq | Nimiq adapter and browser approver for cross-device orders | Generic Better Auth session management | None |
@onmax/unimiq | Nimiq facade, address, signature, transaction, rate, Vue, Vite, Nuxt, mock helpers | ERC-20 contract calls | vue, optional nuxt, vite |
@onmax/unerc20 | ERC-20 reads and transfers through EIP-1193 | NIM transfers | None |
@onmax/better-auth-ledger | App-local balances on Better Auth users | Regulated payment settlement | better-auth |
@onmax/better-auth-nimiq-pay-e2e | Vitest auth scenarios and provider stubs | Production auth runtime | Node >=22 |
@onmax/nimiq-mini-app-kit
Mini-app runtime helpers for Nimiq, Ethereum discovery, simulator tooling, and Nuxt dev integration.
Install @onmax/nimiq-mini-app-kit
| Subpath | Use for |
|---|---|
@onmax/nimiq-mini-app-kit | Provider waits, Ethereum helpers, EIP-6963, language helpers |
@onmax/nimiq-mini-app-kit/dev | Local simulator, stub providers, bridge waits |
@onmax/nimiq-mini-app-kit/host-runtime | Custom simulator host shells |
@onmax/nimiq-mini-app-kit/provider-request-coordinator | Single-flight provider request coordination |
@onmax/nimiq-mini-app-kit/nuxt | Nuxt module and runtime exports |
@onmax/nimiq-mini-app-kit/nuxt/runtime | Nuxt runtime helpers |
import { hasMiniAppProvider, resolveNimiqPayPreferredLanguage } from '@onmax/nimiq-mini-app-kit'
console.log({
available: hasMiniAppProvider(),
language: resolveNimiqPayPreferredLanguage(),
})
Use root imports in browser code. Use /dev only for local simulator and test setup.
@onmax/better-auth-nimiq
Better Auth plugin and client helpers for direct Nimiq authentication.
Install from PKG.new:
| Subpath | Use for |
|---|---|
@onmax/better-auth-nimiq | Server plugin, service, message helpers, address helpers |
@onmax/better-auth-nimiq/client | Client plugin, sign-in helper, token helpers |
@onmax/better-auth-nimiq/server | Server-side crypto and verification helpers |
@onmax/better-auth-nimiq/server-core | Low-level Nimiq Core loading, key derivation, and signed transaction helpers |
@onmax/better-auth-nimiq/provider | Mini-app provider types and provider lookup |
@onmax/better-auth-nimiq/wallet | Deterministic wallet helpers |
@onmax/better-auth-nimiq/kv | KV nonce-store helpers |
@onmax/better-auth-nimiq/nuxt | Nuxt integration helpers |
@onmax/better-auth-nimiq/nuxt-module | Nuxt module entry |
import { nimiqAuth } from '@onmax/better-auth-nimiq'
nimiqAuth({
appName: 'Arcade Rewards',
endpointPrefix: '/nimiq',
nonceTtlSeconds: 300,
})
Use /client in browser code. Use /server, /kv, and root exports in server code.
@onmax/better-auth-cross-device
Better Auth plugin for login, sign, and transaction orders approved on another device.
Install from PKG.new:
| Subpath | Use for |
|---|---|
@onmax/better-auth-cross-device | Server plugin, adapter contract, lifecycle types |
@onmax/better-auth-cross-device/client | Start, claim, approve, reject, cancel, finalize, and SSE helpers |
import { startCrossDeviceOrder, subscribeToCrossDeviceOrder } from '@onmax/better-auth-cross-device/client'
const order = await startCrossDeviceOrder(authClient.$fetch.bind(authClient), {
endpointPrefix: '/cross-device',
kind: 'login',
displayTitle: 'Sign in to Arcade Rewards',
})
subscribeToCrossDeviceOrder({
endpointPrefix: '/cross-device',
orderId: order.orderId,
desktopToken: order.desktopToken,
onEvent: event => console.log(event),
})
Use this package for order state. Pair it with an adapter package such as @onmax/cross-device-nimiq to verify wallet proofs.
@onmax/cross-device-nimiq
Nimiq adapter for cross-device login and sign flows.
Install @onmax/cross-device-nimiq
| Subpath | Use for |
|---|---|
@onmax/cross-device-nimiq | Browser approval helpers and server adapter |
@onmax/cross-device-nimiq/server | Server-focused adapter exports |
import { createNimiqMiniAppApprover, parseCrossDeviceClaimUrl } from '@onmax/cross-device-nimiq'
const claim = parseCrossDeviceClaimUrl(window.location.href)
const approver = createNimiqMiniAppApprover()
await approver.approve(authClient.$fetch.bind(authClient), {
...claim,
endpointPrefix: '/cross-device',
})
Use this in the phone approval surface. Do not expose the desktop token to this code path.
@onmax/unimiq
Universal Nimiq facade with Vite, Vue, and Nuxt integrations.
| Subpath | Use for |
|---|---|
@onmax/unimiq | Facade, address, signature, runtime, rate, and transaction helpers |
@onmax/unimiq/mock | Mock driver |
@onmax/unimiq/drivers | RPC, web-client, and mock drivers |
@onmax/unimiq/vite | Vite plugin |
@onmax/unimiq/vue | Vue address and identicon components |
@onmax/unimiq/nuxt | Nuxt module |
@onmax/unimiq/experimental | Experimental exports |
import { createNimiq } from '@onmax/unimiq'
import { createRpcNimiqDriver } from '@onmax/unimiq/drivers'
export const nimiq = createNimiq({
driver: createRpcNimiqDriver({
networkId: 24,
rpc: {
url: process.env.NIMIQ_RPC_URL!,
},
}),
})
Use /mock or /drivers in tests and server code. Use /vue, /vite, and /nuxt only in matching framework runtimes.
@onmax/unerc20
Portable ERC-20 helpers for EIP-1193 providers.
Exports include readErc20Balance, readErc20Decimals, readErc20Symbol, transferErc20, formatTokenAmountAtomic, parseTokenAmountToAtomic, and ERC20_ABI.
| Export | Use for |
|---|---|
readErc20Balance | eth_call against balanceOf(address) |
readErc20Decimals | eth_call against decimals() unless token metadata provides decimals |
readErc20Symbol | eth_call against symbol() unless token metadata provides symbol |
transferErc20 | eth_sendTransaction with encoded transfer(address,uint256) calldata |
parseTokenAmountToAtomic | User input to atomic bigint; returns null for invalid precision |
formatTokenAmountAtomic | Atomic bigint or string to decimal display |
ERC20_ABI | viem-compatible ABI for custom decoders or simulators |
import { parseTokenAmountToAtomic, transferErc20 } from '@onmax/unerc20'
const amount = parseTokenAmountToAtomic('10.50', 6)
if (amount === null)
throw new Error('Invalid amount')
const hash = await transferErc20(window.ethereum, {
token: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
from: '0x1234567890abcdef1234567890abcdef12345678',
to: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
amount,
})
console.log(hash)
@onmax/better-auth-ledger
Better Auth plugin for app-local virtual balance ledgers.
Install from PKG.new:
| Subpath | Use for |
|---|---|
@onmax/better-auth-ledger | Server plugin, service helpers, types |
@onmax/better-auth-ledger/client | Client plugin and read helpers |
import { ledger } from '@onmax/better-auth-ledger'
ledger({
assets: ['coin', { id: 'gem', maxAmount: 100_000 }],
createAccountOnSignUp: true,
})
Use mutation endpoints only when enableMutations and authorizeMutation are configured. Prefer service helpers for trusted server-side mutations.
@onmax/better-auth-nimiq-pay-e2e
Vitest-first E2E utilities for Nimiq Pay Better Auth integrations.
Install @onmax/better-auth-nimiq-pay-e2e
| Subpath | Use for |
|---|---|
@onmax/better-auth-nimiq-pay-e2e | Scenarios, local fetchers, profiles |
@onmax/better-auth-nimiq-pay-e2e/providers | Stub and bridge providers |
@onmax/better-auth-nimiq-pay-e2e/vitest | Vitest E2E config |
import { expect, test } from 'vitest'
import { runSignInScenario } from '@onmax/better-auth-nimiq-pay-e2e'
test('signs in with a local Nimiq provider', async () => {
const result = await runSignInScenario()
expect(result.ok).toBe(true)
})
Use local mode for CI stability. Use bridge mode only when the environment can publish the injected provider.
Full export index
Use the public API export index when you need to verify a named import or subpath.