Skip to content

anoma/anoma-app-sdk

Repository files navigation

Anoma Pay SDK

TypeScript SDK for the Anoma Pay protocol. Contains domain logic, API clients, WASM bindings, and utilities shared across Anoma Pay applications.

Tech Stack

Setup

Requirements:

  • Node.js (>= 22)
  • npm (bundled with Node.js)
  • Rust toolchain (for WASM builds only)

Install dependencies from the repository root:

npm install

Usage

Import from the SDK using subpath exports:

import { TransferBuilder } from "@anomaorg/anoma-pay-sdk/domain/transfer/models/TransferBuilder";
import { formatBalance } from "@anomaorg/anoma-pay-sdk/lib/utils";
import type { AppResource } from "@anomaorg/anoma-pay-sdk/types";

Building WASM

The SDK includes a Rust-based WASM module for cryptographic operations. Build it with:

npm run build:wasm          # release build
npm run build:wasm:dev      # development build

Pre-built WASM binaries are included in src/wasm/.

Pay Address Format

Anoma Pay uses a custom address format that encodes multiple public keys into a single Base64URL string:

Field Size (bytes)
Authority Public Key 33
Discovery Public Key 33
Encryption Public Key 33
Nullifier Key Commitment 32
CRC32 Checksum 4
Total 135

The raw bytes are concatenated in the order shown above and then encoded using Base64URL encoding. The CRC32 checksum provides integrity verification when decoding addresses.

Audits

Our software undergoes regular audits:

  1. Informal Systems

    Audit Report (pdf)

Project Structure

src/
├── api           # API clients (Backend, Indexer, Envio)
├── domain        # Core domain logic
│   ├── history       # Transaction history types
│   ├── keys          # Key hierarchy structure and services
│   ├── queue         # Transfer queue management
│   ├── resources     # Resource machine handling
│   └── transfer      # Transfer models and services
├── lib           # Shared utility functions
├── wasm          # WASM bindings and pre-built binaries
├── lib-constants.ts  # SDK-level constants
└── types.ts      # Shared type definitions

Linting

npm run lint

Type Checking

npm run tsc-check

Unit Tests

npm run test        # watch mode
npm run test:run    # single run

Repository Conventions

About

Common functionality for using AnomaPay

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors