```import { StarkZap, StarkSigner, Amount, fromAddress, getPresets } from "starkzap";
const sdk = new StarkZap({ network: "sepolia" }); const wallet = await sdk.connectWallet({ account: { signer: new StarkSigner("0xYOUR_PRIVATE_KEY") } });
await wallet.ensureReady({ deploy: "if_needed" });
const { STRK } = getPresets(wallet.getChainId()); const balance = await wallet.balanceOf(STRK);
if (balance.gte(Amount.parse("10", STRK))) { const tx = await wallet.transfer(STRK, [ { to: fromAddress("0xRECIPIENT"), amount: Amount.parse("10", STRK) } ]); await tx.wait(); console.log(tx.explorerUrl); } ```
Key properties: - Gas sponsorship via paymaster (users don’t need gas tokens) - Multiple auth strategies (email/social via Privy, passkeys via Cartridge) - Batch transfers and contract calls in a single atomic transaction - Works in Node, browser, and React Native
The SDK abstracts account management, fee handling, and wallet popups. This won’t make sense for every app (e.g., if you only need fiat checkout). It’s for existing apps that want programmable onchain assets without the wallet UX.
Would appreciate feedback on the API design and whether this abstraction makes sense.
starkience•1h ago
High-level architecture: Accounts are smart contract wallets on Starknet Fees are covered via a paymaster contract It's meant for any builder, you don't have to be a blockchain expert to build with it. Transactions are batched and submitted atomically, so you keep the UX of your existing app.