Overview
Modern Hedera dApps often combine EVM wallets (MetaMask + relay) for Solidity users and native wallets (HashPack / HashConnect) for HTS-native flows. Mirror Node REST supplies cheap historical reads.
When to use this skill
- Choosing MetaMask vs HashConnect per persona (references/wallet-decision-guide.md).
- Implementing polling for transaction receipts / records.
Prerequisites
- Node.js 18+, pnpm or npm.
- Testnet accounts + funded balances.
Workflow
Bootstrap frontend — run scripts/scaffold.sh (wraps
npm create vite).Config relay URL — inject
import.meta.env.VITE_JSON_RPC_URL.Native signing — integrate HashConnect v3 per vendor docs; stub in scripts/wallet-context.tsx.
Mirror reads — axios/fetch wrappers from scripts/mirror-client.ts.
Submit transactions — native SDK via bundled worker OR relay-dependent ethers flows — pick one architecture per app layer.
Errors — map Hedera response codes per references/error-handling.md.
Examples
Example 1
“Need MetaMask-only MVP.”
Use JSON-RPC + ethers; convert HTS interactions via precompile contracts or backend relay.
Example 2
“Need HashPack desktop users.”
Use HashConnect + @hashgraph/sdk signing from dApp connector.
Example 3
“Show NFT gallery from wallet.”
Mirror /api/v1/accounts/{id}/nfts with pagination tokens.
Troubleshooting
| Code | Meaning |
|---|---|
PRECHECK_FAILED |
Generic — inspect nested status |
INVALID_PAYER_SIGNATURE |
Wallet/network mismatch |
References
- Local: references/project-structure.md, references/wallet-decision-guide.md, references/error-handling.md