npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lwk-rn

v0.8.2

Published

Liquid Wallet Kit react native module

Downloads

53

Readme

lwk-rn

Liquid Wallet Kit react native module

Note: Caution this is an Alpha at this stage Please consider reviewing, experimenting and contributing ⚡️

Thanks for taking a look!

Installation

Using npm:

npm install lwk-rn

Using yarn:

yarn add lwk-rn

[IOS Only] Install pods:

npx pod-install
or
cd ios && pod install

Examples

You could run the example in iOS or android by the following

$ yarn example ios
...
$ yarn example android

Create a Wallet and sync with Electrum client

import { Wollet, Client, Signer, Network } from 'lwk-rn';

const mnemonic =
        'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
const network = Network.Testnet;
const signer = await new Signer().create(mnemonic, network);
const descriptor = await signer.wpkhSlip77Descriptor();
console.log(await descriptor.asString());

const wollet = await new Wollet().create(network, descriptor, null);
const client = await new Client().defaultElectrumClient(network);
const update = await client.fullScan(wollet);
await wollet.applyUpdate(update);

Get a new address:

const address = await wollet.getAddress();
console.log(address);

Get a transaction list:

const address = await wollet.getTransactions();
console.log(address);

Get balance as [AssetId : UInt64]:

const balance = await wollet.getBalance();
console.log(balance);

Build, sign and broadcast a Transaction:

    const out_address = await wollet.getAddress().description;
    const satoshis = 900;
    const fee_rate = 280; // this is the sat/vB * 100 fee rate. Example 280 would equal a fee rate of .28 sat/vB. 100 would equal .1 sat/vB
    const builder = await new TxBuilder().create(network);
    await builder.addLbtcRecipient(out_address, satoshis);
    await builder.feeRate(fee_rate);
    let pset = await builder.finish(wollet);
    let signed_pset = await signer.sign(pset);
    let finalized_pset = await wollet.finalize(signed_pset);
    const tx = await finalized_pset.extractTx();
    await client.broadcast(tx);
    console.log("BROADCASTED TX!\nTXID: {:?}", tx.txId.toString());

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

HOWTO

See the how-to to learn how works lwk-rn react native module and the repo code.

Greetings

Thanks to all Blockstream LWK team for the amazing library.

A special thanks to @rcasatta to help me about packaging library for iOS and Android.

A big thanks to @BlakeKaufman because give me the opportunity to build this library with a Bounty and made contributions by itself.

License

MIT


Made with create-react-native-library