# @navalabs/sdk-core

> Shared primitives for the Nava SDK — chain and protocol registries, Nava API client, wallet services, and crypto utilities.

Latest version **0.16.0** (published 2026-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @navalabs/sdk-core
pnpm add @navalabs/sdk-core
yarn add @navalabs/sdk-core
bun add @navalabs/sdk-core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.16.0 |
| Published | 2026-09-23 |
| First published | 2026-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 8 |
| Unpacked size | 529.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | vmichalik, navalabs-admin, navaarch, tim-nava, bernardo-nava |
| Keywords | nava, sdk, blockchain, ethereum, viem, uniswap, registry, wallet, fireblocks, privy |

## Links

- npm: https://www.npmjs.com/package/@navalabs/sdk-core
- Repository: https://github.com/navalabs-dev/sdk
- Homepage: https://github.com/navalabs-dev/sdk#readme
- Issues: https://github.com/navalabs-dev/sdk/issues
- npm.io page: https://npm.io/package/@navalabs/sdk-core

## Dependencies (8)

- [zod](https://npm.io/package/zod.md) ^3.24.3
- [viem](https://npm.io/package/viem.md) 2.47.6
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.0
- [pinata](https://npm.io/package/pinata.md) ^2.0.0
- [openpgp](https://npm.io/package/openpgp.md) ^5.0.0
- [@privy-io/node](https://npm.io/package/@privy-io/node.md) ^0.11.0
- [@fireblocks/ts-sdk](https://npm.io/package/@fireblocks/ts-sdk.md) ^5.0.0
- [@aws-sdk/client-kms](https://npm.io/package/@aws-sdk/client-kms.md) ^3.888.0

## Recent versions

- 0.16.0 (latest) — 2026-09-23
- 0.15.0 — 2026-09-15
- 0.14.0 — 2026-09-02
- 0.13.0 — 2026-08-28
- 0.12.0 — 2026-08-20
- 0.9.0 — 2026-08-07
- 0.8.0 — 2026-06-26
- 0.5.0 — 2026-05-29
- 0.4.0 — 2026-05-28
- 0.2.0 — 2026-04-30

## README

# @navalabs/sdk-core

Shared primitives that power [Nava](https://navalabs.ai) SDK packages. A
dependency-light entry point for consumers who only need the base Nava client,
chain and protocol registries, or wallet/crypto utilities — without the Guardian
verification client, agent-execution runtime, CLI, and MCP server that live in
`@navalabs/sdk`, or the protocol tooling in the adapter packages.

## When to use which package

| Need | Package |
|---|---|
| Chain/protocol registries, Nava HTTP client, wallet adapters | `@navalabs/sdk-core` |
| Full SDK (`NavaClient`, Guardian verification and management, the `nava` CLI, the `nava-mcp` server, agent-execution bootstrap) | `@navalabs/sdk` |
| Uniswap V3/V4 swap and pool tooling | `@navalabs/uniswap-adapter` |
| Hyperliquid perps tooling | `@navalabs/hyperliquid-adapter` |

A protocol operation needs that protocol's adapter. Each adapter depends on `@navalabs/sdk` and ships its own `nava` and `nava-mcp` binaries, so installing the adapter alone is enough. Adapters remain optional peer dependencies of `@navalabs/sdk`, never bundled into it.

`@navalabs/sdk` and both adapters depend on `@navalabs/sdk-core`, so you do not need to install `@navalabs/sdk-core` explicitly unless you want just the primitives.

## Install

```bash
pnpm add @navalabs/sdk-core
# or: npm install @navalabs/sdk-core
# or: yarn add @navalabs/sdk-core
```

Requires Node.js >= 18.

## Quick start — Nava API client

Identical client surface to `@navalabs/sdk`, but without the escrow orchestration layer.

```typescript
import { NavaClient } from '@navalabs/sdk-core';

const nava = new NavaClient({
  apiKey: 'nava_live_...',
  walletAddress: '0xYourAgentWallet',
  // Omit `baseUrl` to use https://internal.navalabs.dev/api
});

// `proposedTx.chainId` is required and must be a chain the registry supports —
// `requestVerification` throws at the SDK boundary otherwise.
const created = await nava.requestVerification({
  prompt: 'Send 0.1 ETH to Alice',
  proposedTx: {
    protocol: 'evm',
    chainId: 11155111,
    to: '0xAlice',
    value: '100000000000000000',
    data: '0x',
  },
});

const status = await nava.waitForVerification(created.requestHash!);
if (!status.canExecute) throw new Error(status.message);
```

When `baseUrl` is omitted, the client talks to
`https://internal.navalabs.dev/api`. Set `baseUrl` for another environment
(devnet is `https://devnet.navalabs.dev/nava-service`).

The request field is `prompt` and the action field is `proposedTx`
(`RequestVerificationParams`). A verdict applies only to the exact action
submitted — Nava never signs or broadcasts; the calling application owns
execution, and only after an approved verdict.

## Getting an agent API key

Agents authenticate with a long-lived agent `x-api-key`. Obtain one through the
Nava UI at [https://app.navalabs.dev](https://app.navalabs.dev) via
OAuth consent or the interactive connect flow, then pass it to `NavaClient`.
SIWE sign-in is no longer exposed by the SDK.

## Registries

`ChainRegistry` and `ProtocolRegistry` expose chain metadata (RPC URLs, block explorers, native tokens) and protocol descriptors (`nava`, `uniswap`, `hyperliquid`, `polymarket`) with typed token and pool entries. The registry is data only — a descriptor existing here does not imply a published adapter. `polymarket` has no published adapter and is not reachable from the `nava` CLI or `nava-mcp`.

```typescript
import {
  ChainRegistry,
  ProtocolRegistry,
  CHAIN_REGISTRY_ENTRIES,
  PROTOCOL_REGISTRY_ENTRIES,
} from '@navalabs/sdk-core';

const sepolia = ChainRegistry.getByChainId(11155111);
const uniswap = ProtocolRegistry.get('uniswap', 1);
```

## Wallet services

Unified `WalletServiceFactory` produces signers for different custody backends via runtime-typed configs:

```typescript
import {
  WalletServiceFactory,
  isPrivyWalletConfig,
  isFireblocksWalletConfig,
  type WalletConfig,
} from '@navalabs/sdk-core';

const wallet = WalletServiceFactory.create(config); // PrivyWalletConfig | FireblocksWalletConfig
```

Supported backends: Privy (`@privy-io/node`), Fireblocks (`@fireblocks/ts-sdk`) including JWT auth, and KMS signing (`@aws-sdk/client-kms`).

## Crypto utilities

PGP and P-256 key generation and format validation:

```typescript
import {
  generatePgpKeyPair,
  generateP256KeyPair,
  validatePgpKey,
  validateP256PublicKey,
  generateNonce,
  getCurrentEnvironment,
} from '@navalabs/sdk-core';
```

## Exports summary

- **HTTP client & errors**: `NavaClient`, `NavaFetchError`, `NavaTimeoutError`, `navaFetchJson`, `navaFetchRaw`
- **Registries**: `ChainRegistry`, `ProtocolRegistry`, and their `*_ENTRIES` arrays
- **Wallet services**: `WalletServiceFactory`, `IWalletService`, `PrivyWalletConfig`, `FireblocksWalletConfig`, `FireblocksAuthMethod`, `FireblocksBasePath`
- **Platform services**: `BlockchainService`, `StorageService`, `EncryptionService`, `NavaApiClient`, `PublicNonceService`, `FireblocksService`, `FireblocksJWTService`, `KMSService`, `KMSSigningService`
- **Crypto**: `generatePgpKeyPair`, `generateP256KeyPair`, `validatePgpKey`, `validateP256PublicKey`, `generateNonce`
- **Utilities**: `Logger`, `logger`, `mcpLogger`, `TransactionGenerator`
- **Types**: `TransactionSchema`, `TransactionRequest`, `AgentContext`, `ExecutionResult`, `VerificationStatusResponse`, `ApprovalDecision`, `ChainRegistryEntry`, `ProtocolRegistryEntry`, and more — the package's type declarations (`dist/index.d.ts`) are the full list.

## License

MIT

---
_Source: https://npm.io/package/@navalabs/sdk-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
