create-starkzap-app
v0.1.1
Published
Interactive CLI to scaffold a Starkzap + Starknet app — Next.js or Vite, Privy or Cartridge
Maintainers
Readme
create-starkzap-app
A CLI scaffold for production-ready Starknet applications. Choose your framework, pick your wallet strategy, and get a fully wired app in seconds — gasless transactions, token balances, and wallet connect included.
npx create-starkzap-appFrameworks
Pick your stack when scaffolding. All three share the same Starkzap SDK core.
| | Next.js 14 | Vite + React | Expo (Mobile) | |---|---|---|---| | Best for | Production web apps, SEO, SSR | SPAs, dashboards, lightweight | iOS & Android | | Router | App Router | React Router / file-based | Expo Router | | Wallet | Argent X, Braavos, Privy | Argent X, Braavos, Privy | Privy (email/social) | | Bundle | Next.js optimized | Vite | Metro |
What's Included
Every scaffold comes with the following out of the box:
| Feature | Details | |---|---| | 🔑 Wallet Connect | Argent X + Braavos via injected provider. Privy social login supported. | | ⛽ Gasless Transactions | AVNU paymaster covers gas — users pay nothing. | | 💰 Token Balances | Live STRK, ETH, USDC balance cards with refresh. | | 💸 Payment UI | Send form with pending / success / error states. | | 🔗 Explorer Links | Auto-links transactions and addresses to Starkscan. | | 🎨 Design System | Dark theme, DM Sans + IBM Plex Mono, Tailwind CSS. |
Stack: Next.js 14 · Vite 5 · Expo 51 · TypeScript · Starkzap SDK · Tailwind CSS · starknet.js
Quickstart
1. Scaffold
Run the CLI and follow the prompts — choose your project name, framework, and wallet strategy:
npx create-starkzap-app2. Configure
cp .env.example .env.localOpen .env.local and fill in:
# "sepolia" for testnet, "mainnet" for production
NEXT_PUBLIC_STARKNET_NETWORK=sepolia
# Free RPC endpoints:
# Blast: https://starknet-sepolia.public.blastapi.io
# Infura: https://starknet-sepolia.infura.io/v3/YOUR_KEY
NEXT_PUBLIC_STARKNET_RPC_URL=https://starknet-sepolia.public.blastapi.io
# Optional — Privy app ID for social/email login (https://privy.io)
NEXT_PUBLIC_PRIVY_APP_ID=
# Optional — AVNU API key for gasless transactions (leave blank to skip)
NEXT_PUBLIC_AVNU_API_KEY=3. Run
npm run devOpen http://localhost:3000 and connect your wallet.
Extending the Kit
Token Swaps via AVNU
import { StarkZap, AvnuSwapProvider, getPresets, Amount } from "starkzap";
const sdk = new StarkZap({ network: "mainnet" });
const wallet = await sdk.connectWallet({
account: { signer },
swapProviders: [new AvnuSwapProvider()],
defaultSwapProviderId: "avnu",
});
const { STRK, USDC } = getPresets(wallet.getChainId());
const tx = await wallet.swap({
tokenIn: STRK,
tokenOut: USDC,
amountIn: Amount.parse("10", STRK),
slippageBps: 50n,
});
await tx.wait();STRK Staking
const stakingPools = await wallet.staking().getPools();
const tx = await wallet.staking().stake({
pool: stakingPools[0],
amount: Amount.parse("100", STRK),
});
await tx.wait();Batch Multiple Transactions
const tx = await wallet
.tx()
.transfer({ to: addr1, token: STRK, amount: Amount.parse("5", STRK) })
.transfer({ to: addr2, token: USDC, amount: Amount.parse("10", USDC) })
.execute({ feeMode: "sponsored" });
await tx.wait();Deployment
Vercel (Recommended)
npm install -g vercel
vercelSet your environment variables in the Vercel dashboard. Switch NEXT_PUBLIC_STARKNET_NETWORK to mainnet for production.
Manual Build
npm run build
npm startResources
MIT License · Built on Starknet
