-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial version of wasm-miniscript package
Issue: BTC-1317
- Loading branch information
1 parent
677d2f8
commit e148c7a
Showing
21 changed files
with
5,848 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: wasm-miniscript | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
- rel/** | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [18.x, 20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup node:${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
|
||
- name: Install wasm-pack | ||
run: | | ||
cargo install wasm-pack | ||
- name: Build Info | ||
run: | | ||
echo "node $(node --version)" | ||
echo "npm $(npm --version)" | ||
echo "yarn $(yarn --version)" | ||
git --version | ||
echo "base ref $GITHUB_BASE_REF" | ||
echo "head ref $GITHUB_HEAD_REF" | ||
- name: Fetch Base Ref | ||
run: | | ||
git fetch origin $GITHUB_BASE_REF | ||
- name: Install Packages | ||
run: yarn install --with-frozen-lockfile | ||
|
||
- name: build packages | ||
run: yarn run build | ||
|
||
- name: Check Source Code Formatting | ||
run: yarn lerna exec 'prettier --check .' | ||
|
||
- name: Unit Test | ||
run: yarn lerna run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.idea/ | ||
*.iml |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# wasm-miniscript | ||
WebAssembly bindings for rust-miniscript | ||
|
||
This is a wrapper around the [rust-miniscript](https://github.com/rust-bitcoin/rust-miniscript) crate that is compiled | ||
to WebAssembly. It allows you to use Miniscript in NodeJS and in the browser. | ||
|
||
|
||
# Dependencies | ||
|
||
- [Rust](https://www.rust-lang.org/) nightly | ||
- [wasm-pack](https://rustwasm.github.io/wasm-pack/) (install with `cargo install wasm-pack`) | ||
- [NodeJS](https://nodejs.org/en/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "node_modules/lerna/schemas/lerna-schema.json", | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "root", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"scripts": { | ||
"check-fmt": "lerna run check-fmt" | ||
}, | ||
"devDependencies": { | ||
"lerna": "^8.1.6", | ||
"prettier": "^3.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
target/ | ||
js/wasm/ | ||
js/browser/ | ||
node_modules/ | ||
# we actually only track the .ts files | ||
js/*.js | ||
js/*.d.ts | ||
test/*.js | ||
test/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extension": ["js", "ts"], | ||
"require": "ts-node/register" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
js/wasm | ||
target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "wasm-miniscript" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
wasm-bindgen = "0.2" | ||
js-sys = "0.3" | ||
miniscript = "12" |
Oops, something went wrong.