https://github.com/zh/bch-wallet-kit
Simple components to construct various BCH related applications - wallets, DEXes etc.
https://github.com/zh/bch-wallet-kit
Last synced: 4 months ago
JSON representation
Simple components to construct various BCH related applications - wallets, DEXes etc.
- Host: GitHub
- URL: https://github.com/zh/bch-wallet-kit
- Owner: zh
- License: mit
- Created: 2025-01-20T10:06:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-05T06:39:14.000Z (about 1 year ago)
- Last Synced: 2025-10-18T21:29:04.391Z (9 months ago)
- Language: JavaScript
- Size: 681 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bch-wallet-kit
Simple components to construct various BCH related applications - wallets, DEXes etc.
[bch-wallet-kit](https://github.com/zh/bch-wallet-kit) is a great JavaScript library for working with Bitcoin Cash. It is using the services, provided by [FullStack.cash](https://fullstack.cash/) to communicate with BCH blockchain.
The real blockchain interactions are provided by [minimal-slp-wallet](https://www.npmjs.com/package/minimal-slp-wallet) CLI wallet library.
Some library features:
- [jotai](https://jotai.org/) state management for preserving current state
- [minimal-slp-wallet](https://www.npmjs.com/package/minimal-slp-wallet) for blockchain operations
- does not leave footprints in the browser - local storage etc. (as a result, you can have many wallets in the same browser)
- minimal formating - no external frameworks, just simple CSS, included in the package
## Usage
Initial file structure can be created in many ways, but [vite](https://github.com/vitejs/vite) is pretty good for this.
- Create new vite project
```bash
npm create vite@latest vite-wallet -- --template react
cd vite-wallet/
```
- Install required libraries:
```bash
npm install minimal-slp-wallet bch-wallet-kit --save
```
- Copy minimal-slp-library to public/ folder (*TODO: simplify this step*)
```bash
cp node_modules/minimal-slp-wallet/dist/minimal-slp-wallet.min.js public/
```
Inside *examples/* directory you can just run `npm run script` for this task. This task is also automatically executed for all examples, when starting the development environment with `npm run dev`.
- Replace `src/App.jsx` with the following code:
```js
import { useAtom } from 'jotai';
import { walletConnectedAtom } from 'bch-wallet-kit';
import { Notify, LoadScript, Mnemonic, Options, Wallet } from 'bch-wallet-kit';
import 'bch-wallet-kit/dist/BchWalletKit.css';
import './App.css';
const App = () => {
const [walletConnected] = useAtom(walletConnectedAtom);
return (
BCH Wallet
{!walletConnected && (
<>
>
)}
);
};
export default App;
```
- Start the application (by default running as `http://localhost:5173/`)
```bash
npm run dev
```
See [GH example directory](https://github.com/zh/bch-wallet-kit/tree/main/examples) for more examples.