A TypeScript SDK for interacting with MIST.cash - a privacy-focused protocol on Starknet.
The MIST SDK is a monorepo containing multiple packages that provide different layers of functionality for building applications with MIST.cash:
-
@mistcash/react - React hooks for easy integration
npmjs.com/@mistcash/react -
@mistcash/sdk - Core SDK with contract utilities
npmjs.com/@mistcash/sdk -
@mistcash/config - Configuration, ABIs, and contract addresses, tokens
npmjs.com/@mistcash/config
pnpm add @mistcash/reactpnpm add @mistcash/sdkReact hooks and utilities for MIST.cash integration. Provides the useMist hook that manages state, asset fetching, and transaction sending.
Key Features:
- Input state management (
val*,set*items) - Asset selection and fetching
- Contract interaction with loading states
- Transaction error handling
Core SDK containing the fundamental utilities for interacting with MIST.cash contracts.
Key Features:
- Typed contract creation (
getChamber) - Asset fetching from transactions (
fetchTxAssets) - Transaction validation and verification
Configuration package containing ABIs, contract addresses, and type definitions.
Key Features:
- Chamber contract ABI (
CHAMBER_ABI) - Mainnet contract addresses (
CHAMBER_ADDR_MAINNET) - TypeScript contract types (
ChamberTypedContract)
import { getChamber, fetchTxAssets } from '@mistcash/sdk';
const contract = getChamber(provider);
const assets = await fetchTxAssets(contract, transactionKey, recipientAddress);
console.log('Available assets:', assets);import { txSecret } from '@mistcash/crypto';
import { getChamber } from '@mistcash/sdk';
const contract = getChamber(provider);
const secret = await txSecret(valKey, valTo);
const asset = await contract.read_tx(secret);import { txHash } from '@mistcash/crypto';
const hash = await txHash(transactionKey, recipientAddress, tokenAddress, amount);fetchTxAssets function will show assets even if the transaction has already been used.
fetchTxAssets guarantees that a transaction was generated but does not verify if it's still spendable.
We welcome contributions! Please see our Contributing Guide for details on how to get started.
# Clone the repository
git clone https://github.com/mistcash/sdk.git
cd sdk
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm testMIT License - see LICENSE file for details.
- Documentation: docs.mistcash.com (coming soon)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ for the Starknet ecosystem.