Note
This Kaspa wallet is open-source and compliant with KIP99. Initially developed by Dwayne and Coinchimp, it also integrates KRC20 functionalities.
Tip
Watch KSPR wallet in action
KSPR-wallet.mp4
This boilerplate is made for creating Kaspa wallet chrome/firefox extensions using React and Typescript.
The focus was on improving the build speed and development experience with Vite(Rollup) & Turborepo.
- React18
- TypeScript
- Tailwindcss
- Vite
- Turborepo
- Prettier
- ESLint
- Chrome Extension Manifest Version 3
- Custom I18n Package
- Custom HMR(Hot Module Rebuild) Plugin
- Clone this repository.
- Change
extensionDescriptionandextensionNameinmessages.jsonfile. - Install pnpm globally:
npm install -g pnpm(check your node version >= 18.12.0) - Run
pnpm install
- Run:
- Dev:
pnpm dev- When you run with Windows, you should run as administrator. (Issue#456)
- Prod:
pnpm build
- Dev:
- Open in browser -
chrome://extensions - Check -
Developer mode - Find and Click -
Load unpacked extension - Select -
distfolder at root
- Run:
- Dev:
pnpm dev:firefox - Prod:
pnpm build:firefox
- Dev:
- Open in browser -
about:debugging#/runtime/this-firefox - Find and Click -
Load Temporary Add-on... - Select -
manifest.jsonfromdistfolder at root
Remember in firefox you add plugin in temporary mode, that's mean it's disappear after close browser, you must do it again, on next launch.
Main app with background script, manifest
manifest.js- manifest for chrome extensionlib/background- background script for chrome extension (background.service_workerin manifest.json)public/content.css- content css for user's page injection
Some shared packages
dev-utils- utils for chrome extension development (manifest-parser, logger)i18n- custom i18n package for chrome extension. provide i18n function with type safety and other validation.hmr- custom HMR plugin for vite, injection script for reload/refresh, hmr dev-servershared- shared code for entire project. (types, constants, custom hooks, components, etc.)storage- helpers for storage easier integration with, e.g local, session storagestailwind-config- shared tailwind config for entire projecttsconfig- shared tsconfig for entire projectui- here's a function to merge your tailwind config with global one, and you can save components herevite-config- shared vite config for entire projectzipper- Bypnpm zipyou can packdistfolder intoextension.zipinside newly createddist-zip
popup- popup for chrome extension (action.default_popupin manifest.json)side-panel- sidepanel(Chrome 114+) for chrome extension (side_panel.default_pathin manifest.json)