mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-26 01:14:21 +01:00
2.0 KiB
2.0 KiB
Development guide - Wasm package
When developing, it can be useful to work with a locally built version of the Breez Liquid SDK instead of relying on what is published already. To do this, you first need to build the Breez Liquid SDK bindings locally and then point the examples to make use of the locally built Breez Liquid SDK Wasm package.
All the following commands can be run in the packages/wasm directory.
Prerequisites
To build some dependencies you need to first install
- Protobuf
- Emscripten for compiling to Wasm
- Firefox for testing Wasm
brew install protobuf emscripten
On first usage you will need to run:
make init
Build
To build the Wasm code run:
make build
This will generate the following artifacts:
- Bundle - suitable for use with bundlers like Webpack
bundle/package.jsonbundle/breez_sdk_liquid_wasm.d.tsbundle/breez_sdk_liquid_wasm.jsbundle/breez_sdk_liquid_wasm_bg.jsbundle/breez_sdk_liquid_wasm_bg.wasmbundle/breez_sdk_liquid_wasm_bg.wasm.d.ts
- Deno - ES module for use with Deno
deno/breez_sdk_liquid_wasm.d.tsdeno/breez_sdk_liquid_wasm.jsdeno/breez_sdk_liquid_wasm_bg.wasmdeno/breez_sdk_liquid_wasm_bg.wasm.d.ts
- Node - CommonJS module for use with Node.js
node/package.jsonnode/breez_sdk_liquid_wasm.d.tsnode/breez_sdk_liquid_wasm.jsnode/breez_sdk_liquid_wasm_bg.wasmnode/breez_sdk_liquid_wasm_bg.wasm.d.ts
- Web - ES module for use in browsers
web/package.jsonweb/breez_sdk_liquid_wasm.d.tsweb/breez_sdk_liquid_wasm.jsweb/breez_sdk_liquid_wasm_bg.wasmweb/breez_sdk_liquid_wasm_bg.wasm.d.ts
Testing with the examples
To test locally built bindings in the examples, the npm dependencies need to be updated to use the local package.
"@breeztech/breez-sdk-liquid": "file:../../",