Skip to content

Commit b4dcb30

Browse files
shesekjgriffiths
authored andcommitted
wasm: Add a minimal README
1 parent 3fecdca commit b4dcb30

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/wasm_package/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# libwally JS
2+
3+
WASM-based JavaScript bindings for [libwally](https://github.com/elementsproject/libwally-core),
4+
for nodejs and the browser.
5+
6+
## Installation
7+
8+
```bash
9+
$ npm install wallycore
10+
```
11+
12+
## Example use
13+
14+
```js
15+
import wally from 'wallycore'
16+
17+
const word = wally.bip39_get_word(null, 10)
18+
19+
const script = wally.address_to_scriptpubkey("1EMBaSSyxMQPV2fmUsdB7mMfMoocgfiMNw", wally.WALLY_NETWORK_BITCOIN_MAINNET)
20+
21+
const tx = wally.tx_from_hex('020000...', 0)
22+
console.log(wally.tx_get_txid(tx).toString('hex))
23+
wally.tx_free(tx)
24+
```
25+
26+
If you're using CommonJS, the module can be loaded asynchronously using `const wally = await import('wallycore')` or `import('wallycore').then(wally => { ... })`.
27+
28+
## License
29+
[BSD/MIT](https://github.com/ElementsProject/libwally-core/blob/master/LICENSE)

0 commit comments

Comments
 (0)