Getting Started
Installation
Install the NERO MPC SDK, peer dependencies, and choose the right package modules for your use case
Installation
Install the SDK
npm install @nerochain/mpc-sdkRequired Peer Dependencies
The SDK depends on @noble/curves and @noble/hashes for all MPC and cryptographic operations:
npm install @noble/curves @noble/hashes| Package | Version | Purpose |
|---|---|---|
@noble/curves | ^1.4.0 | All MPC and cryptographic operations |
@noble/hashes | ^1.4.0 | Key derivation (HKDF) and hashing |
Optional Peer Dependencies
Install these based on the features you need:
| Package | Version | When to install |
|---|---|---|
react | ^18.0.0 | React hooks, context provider, or modal UI |
ethers | ^6.0.0 | Account Abstraction (ERC-4337) or Pedersen signing |
@metamask/sdk | ^0.20.0 | MetaMask wallet adapter |
@walletconnect/ethereum-provider | — | WalletConnect support |
@coinbase/wallet-sdk | — | Coinbase Wallet support |
Package Modules
The SDK is distributed as a multi-entry package. Import only the modules you need to optimize your bundle size:
| Import Path | Entry File | Purpose |
|---|---|---|
@nerochain/mpc-sdk | src/index.ts | Core SDK class, MPC protocols, and shared types |
@nerochain/mpc-sdk/react | src/react/index.ts | React Context providers and hooks for state management |
@nerochain/mpc-sdk/chains | src/chains/index.ts | Pre-defined chain configurations and network managers |
@nerochain/mpc-sdk/modal | src/modal/index.ts | Pre-built UI components for login and wallet management |
@nerochain/mpc-sdk/no-modal | src/no-modal/index.ts | Headless SDK surface for custom UI implementations |
@nerochain/mpc-sdk/aa | src/aa/index.ts | ERC-4337 Account Abstraction utilities and clients |
Primary Exports by Module
- Main (
@nerochain/mpc-sdk):NeroMpcSDK,ClientKeyManager,APIClient,NeroProvider - React (
@nerochain/mpc-sdk/react):NeroMpcAuthProvider,useNeroConnect,useNeroWallet - Chains (
@nerochain/mpc-sdk/chains):ChainManager,ChainConfig,NERO_TESTNET - Modal (
@nerochain/mpc-sdk/modal):LoginButton,LoginModal,AllWalletsView - AA (
@nerochain/mpc-sdk/aa):BundlerClient,PaymasterClient,SimpleAccount
Build Configuration
The SDK ships with these build settings:
| Setting | Value |
|---|---|
| Target | ES2020 |
| Platform | Browser (Node.js crypto disabled) |
| Formats | Dual ESM and CommonJS |
| Treeshaking | Enabled |
Requirements
- Browser with Web Crypto API support (all modern browsers)
- Node.js 18+ for build tooling
- React 18+ if using the React or Modal entry points