@midnightntwrk/wallet-sdk-utilities
Domain-agnostic utilities for the Midnight Wallet SDK.
Installation
npm install @midnightntwrk/wallet-sdk-utilities
Overview
This package provides common utility functions and types used throughout the Midnight Wallet SDK. It includes:
- Array operations
- Blob/binary data operations
- Date utilities
- Either/Result type operations
- Fluent API helpers
- Heterogeneous list types
- Ledger operations
- Observable utilities
- Polymorphic functions
- Record operations
Exports
Default Export
import {
ArrayOps, // Array manipulation utilities
BlobOps, // Binary data operations
DateOps, // Date handling utilities
EitherOps, // Either/Result type helpers
Fluent, // Fluent API patterns
HList, // Heterogeneous list types
LedgerOps, // Ledger-specific operations
ObservableOps, // RxJS Observable utilities
Poly, // Polymorphic function helpers
RecordOps, // Object/Record utilities
} from '@midnightntwrk/wallet-sdk-utilities';
Networking Submodule (/networking)
Network-related utilities:
import { ... } from '@midnightntwrk/wallet-sdk-utilities/networking';
Types Submodule (/types)
Common type definitions:
import { ... } from '@midnightntwrk/wallet-sdk-utilities/types';
Testing Submodule (/testing)
Testing utilities and helpers:
import { ... } from '@midnightntwrk/wallet-sdk-utilities/testing';
Usage Examples
Observable Operations
import { ObservableOps } from '@midnightntwrk/wallet-sdk-utilities';
// Convert Effect streams to RxJS Observables
const observable = ObservableOps.fromStream(effectStream);
Array Operations
import { ArrayOps } from '@midnightntwrk/wallet-sdk-utilities';
// Various array manipulation utilities
License
Apache-2.0