> ## 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.

# Api reference

# Rust: API Reference

Complete method surface for the `notareum` Rust crate (published on crates.io). All `async` methods require a Tokio runtime; all write methods require a signer in the client configuration.

## Factory

```rust theme={"system"}
use notareum::{Notareum, ClientConfig, ContractAddresses, SdkError};

impl Notareum {
    pub fn new(config: ClientConfig) -> Result<Notareum, SdkError>;
}

pub struct ClientConfig {
    pub provider: std::sync::Arc<ethers::providers::Provider<ethers::providers::Http>>,
    pub signer:   Option<ethers::signers::LocalWallet>,
    pub contracts: ContractAddresses,
}

pub struct ContractAddresses {
    pub access_manager:      String,
    pub nota_token:          String,
    pub ve_nota:             String,
    pub validator_staking:   String,
    pub nota_registry:       String,
    pub verification_engine: String,
    pub slashing_manager:    String,
    pub fee_manager:         String,
}
```

Each sub-client is a public field on the `Notareum` struct: `ntm.nota`, `ntm.registry`, `ntm.verification`, `ntm.staking`, `ntm.governance`, `ntm.fee`.

## `NotaFileClient` (`ntm.nota`)

```rust theme={"system"}
impl NotaFileClient {
    pub fn create(&self, options: CreateNotaOptions) -> Result<NotaBuilder, SdkError>;
    pub fn parse(&self, content: &str) -> Result<NotaFile, SdkError>;
    pub fn validate(&self, nota: &NotaFile) -> Result<(), SdkError>;
    pub fn is_valid(&self, nota: &NotaFile) -> bool;
    pub fn serialize(&self, nota: &NotaFile) -> Result<String, SdkError>;
}

impl NotaBuilder {
    pub fn sign(self, private_key_hex: &str) -> Result<Self, SdkError>;
    pub fn validate(self) -> Result<Self, SdkError>;
    pub fn serialize(&self) -> Result<String, SdkError>;
    pub fn build(self) -> NotaFile;
}

pub struct CreateNotaOptions {
    pub type_: String,            // `type` is reserved in Rust; field is `type_`
    pub chain_name: String,
    pub chain_id: u64,
    pub network: Option<String>,
    pub identifier: String,
    pub name: Option<String>,
    pub alias: Option<String>,
    pub description: Option<String>,
    pub resource_metadata: Option<serde_json::Value>,
    pub issuer_name: Option<String>,
    pub issuer_entity_type: Option<String>,
}

impl CreateNotaOptions {
    pub fn new(
        type_: impl Into<String>,
        chain_name: impl Into<String>,
        chain_id: u64,
        identifier: impl Into<String>,
    ) -> Self;
}
```

## `RegistryClient` (`ntm.registry`)

```rust theme={"system"}
impl RegistryClient {
    pub async fn register_resource(
        &self,
        resource_type: u8,
        chain_id: u64,
        identifier: &str,
        proof_hash: &str,
        alias: Option<&str>,
    ) -> Result<String, SdkError>;

    pub async fn get_resource(&self, resource_id: &str) -> Result<ResourceInfo, SdkError>;
    pub async fn resolve_alias(&self, alias: &str) -> Result<String, SdkError>;
    pub async fn revoke_resource(&self, resource_id: &str) -> Result<String, SdkError>;

    pub fn compute_resource_id(
        &self,
        resource_type: u8,
        chain_id: u64,
        identifier: &str,
    ) -> Result<String, SdkError>;

    pub async fn add_resource_type(&self, type_id: u8, name: &str) -> Result<String, SdkError>;
    pub async fn remove_resource_type(&self, type_id: u8) -> Result<String, SdkError>;
    pub async fn is_valid_resource_type(&self, type_id: u8) -> Result<bool, SdkError>;
    pub async fn get_resource_type_name(&self, type_id: u8) -> Result<String, SdkError>;
}
```

## `VerificationClient` (`ntm.verification`)

```rust theme={"system"}
impl VerificationClient {
    pub async fn request_verification(
        &self,
        resource_id: &str,
        level: VerificationLevel,
    ) -> Result<String, SdkError>;

    pub async fn submit_attestation(
        &self,
        resource_id: &str,
        approved: bool,
    ) -> Result<String, SdkError>;

    pub async fn get_verification_request(
        &self,
        request_id: ethers::types::U256,
    ) -> Result<VerificationRequestInfo, SdkError>;

    pub async fn get_verification_fee(
        &self,
        level: VerificationLevel,
    ) -> Result<ethers::types::U256, SdkError>;
}
```

## `StakingClient` (`ntm.staking`)

```rust theme={"system"}
impl StakingClient {
    pub async fn stake(&self, amount: ethers::types::U256) -> Result<String, SdkError>;
    pub async fn unstake(&self) -> Result<String, SdkError>;
    pub async fn claim_stake(&self) -> Result<String, SdkError>;

    pub async fn get_validator_info(&self, address: &str) -> Result<ValidatorInfo, SdkError>;
    pub async fn get_tier(&self, address: &str) -> Result<ValidatorTier, SdkError>;
    pub async fn get_daily_verifications_remaining(&self, address: &str) -> Result<ethers::types::U256, SdkError>;
}
```

## `GovernanceClient` (`ntm.governance`)

```rust theme={"system"}
impl GovernanceClient {
    pub async fn lock(&self, amount: U256, duration: U256) -> Result<String, SdkError>;
    pub async fn extend_lock(
        &self,
        lock_id: U256,
        additional_duration: U256,
    ) -> Result<String, SdkError>;
    pub async fn unlock(&self, lock_id: U256) -> Result<String, SdkError>;

    pub async fn get_voting_power(&self, address: &str) -> Result<U256, SdkError>;
    pub async fn get_lock(&self, lock_id: U256) -> Result<VeNotaLock, SdkError>;
    pub async fn get_total_supply(&self) -> Result<U256, SdkError>;
}
```

`U256` here refers to `ethers::types::U256`.

## `FeeClient` (`ntm.fee`)

```rust theme={"system"}
impl FeeClient {
    pub async fn get_verification_fee(&self, level: VerificationLevel) -> Result<U256, SdkError>;
    pub async fn get_alias_fee(&self) -> Result<U256, SdkError>;
    pub async fn get_dispute_bond(&self) -> Result<U256, SdkError>;
    pub async fn get_fee_collector(&self) -> Result<String, SdkError>;
    pub async fn get_fee_config(&self) -> Result<FeeConfig, SdkError>;

    // Governance only
    pub async fn set_verification_fee(
        &self,
        level: VerificationLevel,
        fee: U256,
    ) -> Result<String, SdkError>;
    pub async fn set_alias_fee(&self, fee: U256) -> Result<String, SdkError>;
}
```

## Enums

```rust theme={"system"}
pub enum VerificationLevel { Basic, Enhanced, Institutional }
pub enum VerificationStatus { Pending, Approved, Rejected, Expired }
pub enum ValidatorTier { None, Bronze, Silver, Gold, Platinum }
```

The `ValidatorTier` variants map to protocol tiers `BASIC`, `PROFESSIONAL`, `ENTERPRISE`, `INSTITUTIONAL` (see [Staking and Tiers](../../protocol/staking-and-tiers.md)).

## Off-chain primitives module: `notareum::core`

The merged `core` module exposes the lower-level building blocks used by the high-level clients:

* `notareum::core::crypto` (keccak256, EIP-191 personal-sign signer/verifier)
* `notareum::core::nota` (`NotaFile` types, builder, parser, validator)
* `notareum::core::registry` (resource id derivation, resource types)
* `notareum::core::staking` (tier types)
* `notareum::core::verification` (quorum math, types)
* `notareum::core::constants` (schema version, resource type constants)
* `notareum::core::error::CoreError`

These primitives are byte-compatible with the TS and Python SDKs and can be used standalone (e.g. in WASM contexts) without instantiating a `Notareum` client.

## Errors

All fallible calls return `Result<T, SdkError>`. `SdkError` is a `thiserror` enum covering provider errors, revert decoding, missing signer, schema failures, and local validation issues. See [Error Codes](../../reference/error-codes.md).
