> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notareum.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting started

# TypeScript: Getting Started

`@notareum/sdk` is the official TypeScript client for the Notareum Protocol. It works in Node.js 20+, modern browsers (via a bundler), and any framework that accepts standard ESM modules. This page installs the SDK, wires up a provider and signer, and produces your first signed `.nota` file.

## Install

```bash theme={"system"}
npm install @notareum/sdk ethers
# or
pnpm add @notareum/sdk ethers
# or
yarn add @notareum/sdk ethers
```

`ethers` v6 is a peer dependency. The SDK does not bundle it so you control which version your app ships.

## Requirements

* Node.js 20 or newer (for ESM + `globalThis.crypto`).
* TypeScript 5.0+ recommended (the SDK ships `.d.ts`).
* An Ethereum JSON-RPC endpoint (Alchemy, Infura, QuickNode, local Hardhat, etc.).
* A signer (a private key, browser wallet, or hardware wallet).

## Create a Notareum instance

```typescript theme={"system"}
import { Notareum } from "@notareum/sdk";
import { JsonRpcProvider, Wallet } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL!);
const signer = new Wallet(process.env.PRIVATE_KEY!, provider);

const ntm = Notareum({
  provider,
  signer,
  contracts: {
    notaToken: process.env.NOTA_TOKEN!,
    veNota: process.env.VE_NOTA!,
    validatorStaking: process.env.VALIDATOR_STAKING!,
    notaRegistry: process.env.NOTA_REGISTRY!,
    verificationEngine: process.env.VERIFICATION_ENGINE!,
    slashingManager: process.env.SLASHING_MANAGER!,
    feeManager: process.env.FEE_MANAGER!,
    accessManager: process.env.ACCESS_MANAGER!,
  },
});
```

Current contract addresses live in [Contract Addresses](../../reference/contract-addresses.md).

You only need `signer` for write operations (registering, attesting, staking, locking veNOTA). A bare provider is enough for reads.

## Your first .nota file

Signing a `.nota` file does not require on-chain calls. This runs instantly with only a signer:

```typescript theme={"system"}
const built = await ntm.nota
  .create({
    type: "address",
    chainName: "ethereum",
    chainId: 1,
    identifier: await signer.getAddress(),
    name: "My wallet",
    description: "Primary hot wallet",
    issuerName: "Alice",
    issuerEntityType: "individual",
  })
  .validate()
  .sign(signer);

const serialized = built.serialize();
console.log(serialized);
```

`serialize()` returns a canonical JSON string safe to transport over any channel: email, QR code, messaging app, HTTP body. Recipients can parse and verify it with `ntm.nota.parse()` and `ntm.nota.validate()`.

## Read a contract

No signer required for reads. This returns the on-chain registration record for a resource ID:

```typescript theme={"system"}
const info = await ntm.registry.getResource(
  "0x1234...resourceIdHex..."
);
console.log(info.owner, info.verificationLevel, info.isRevoked);
```

## Write a contract

Registration is a write. The SDK returns the transaction hash:

```typescript theme={"system"}
const txHash = await ntm.registry.registerResource(
  0,             // ResourceType.ADDRESS
  1n,            // chainId
  await signer.getAddress(),
  "0x" + "0".repeat(64), // proofHash (keccak256 of .nota file)
  "alice.eth"    // alias (optional)
);
console.log("Registered:", txHash);
```

## Next steps

* [Working with .nota files](nota-files.md)
* [Registering resources on-chain](registry.md)
* [Requesting verification](verification.md)
* [Full API Reference](api-reference.md)
