@xstoicunicornx/payjoin
v0.0.5
Published
JavaScript/WASM bindings for rust-payjoin
Downloads
596
Maintainers
Readme
Payjoin JavaScript Bindings
Welcome to the JavaScript language bindings for the Payjoin Dev Kit!
Usage
Install
npm install payjoinImport
For node environments:
import { uniffiInitAsync, payjoin } from "payjoin";
// initialize before usage
await uniffiInitAsync();For web browser environments:
import * as payjoin from "payjoin/web";
// or for usage with Vite
import * as payjoin from "payjoin/web-vite";
// initialize before usage
await payjoin.uniffiInitAsync();Build Bindings
Follow these steps to clone the repository and run the tests. This assumes you already have Rust and Node.js installed.
git clone https://github.com/payjoin/rust-payjoin.git
cd rust-payjoin/payjoin-ffi/javascript
# Clean out stale dependencies
npm run clean
rm -rf node_modules
# Install dependencies
cargo install wasm-bindgen-cli
# (macOS only - secp256k1-sys requires a WASM-capable C compiler)
brew install llvm
npm install
# Generate the bindings
bash ./scripts/generate_bindings.sh
Running Tests
# Run all tests
npm test
Made with uniffi-bindgen-react-native
