What is @chipi-stack/core?
@chipi-stack/core provides opt-in transaction primitives for developers who need fine-grained control over StarkNet operations. It complements the existing hooks-based SDKs (Next.js, React, Expo) with lower-level building blocks.
When to use core vs hooks
| Use Case | Recommended | Why |
|---|---|---|
| Standard transfers in a React app | Hooks (useTransfer) | Simpler, handles state management |
| Batch approve + transfer atomically | Core (TxBuilder) | Hooks don’t support multicall batching |
| Display formatted balances | Either | Core’s Amount class or shared’s formatAmount |
| Custom contract interactions with fee preview | Core (TxBuilder.estimateFee()) | Hooks don’t expose fee estimation |
| Backend automation with programmatic signing | Core (DirectSigner + TxBuilder) | No React context available |
| Swap passkey for Argent/Braavos wallet signer | Core (ExternalSigner) | Hooks are hardwired to passkey flow |
| Gasless transactions with any wallet (Argent X, Braavos, Cartridge, DirectSigner) | Core (TxBuilder.sendSponsored()) | Uses Chipi’s paymaster for gas sponsorship |
Installation
Quick Example
Package Architecture
core depends only on @chipi-stack/types. It does not modify or depend on @chipi-stack/shared, keeping the two packages independent.
What’s Inside
Amount
Immutable token amount class with BigInt arithmetic, parsing, and formatting.
TxBuilder
Fluent builder for batching StarkNet multicalls into atomic transactions.
Erc20
Typed ERC20 contract wrapper that returns Amount objects.
TokenRegistry
Token metadata lookup by symbol or address, with network presets.
SignerAdapter
Unified signing interface for passkeys, direct keys, and external providers.
