Skip to main content

Examples

Starter project​

The build-crackpay-miniapp skill ships a complete Vite + React + TypeScript Mini App: auto-connect, a greeting by handle, the USDC balance, a sample payment and error handling.

npx skills add crackedstudio/crackpay-skills --skill build-crackpay-miniapp

Then ask your assistant to "create a CrackPay Mini App".

Common patterns​

Wallet connection​

const crackpay = await connectCrackPay();
if (!crackpay) return showOpenInCrackPay();

Greeting by handle​

const name = crackpay.handle ? `@${crackpay.handle}` : `${crackpay.account.slice(0, 6)}…`;

Token balance​

See Retrieve balance.

Paying a contract​

await walletClient.writeContract({
account, chain: walletClient.chain,
address: SHOP, abi, functionName: "checkout", args: [orderId],
value: parseEther(total),
});

Working inside and outside CrackPay​

See Running inside and outside CrackPay.

Real apps​

Send USDC or EURC as a link that anyone can claim. Its CrackPay integration makes it use the CrackPay account as its wallet from the start, with claims going straight to the CrackPay account. It uses a payable escrow contract for USDC and the approve-then-call flow for EURC.

Use cases​

Use casePattern
CheckoutA payable function per order, with an orderId
TippingA plain payment to the creator, greeting the tipper by handle
Group savingsA contract that holds deposits; reads with multicall
RewardsYour contract pays out; the app reads the balance